Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic for image generation #17

Closed
toonarmycaptain opened this issue Oct 4, 2018 · 8 comments
Closed

Logic for image generation #17

toonarmycaptain opened this issue Oct 4, 2018 · 8 comments
Labels
enhancement New feature or request Hacktoberfest help wanted Extra attention is needed

Comments

@toonarmycaptain
Copy link
Owner

toonarmycaptain commented Oct 4, 2018

Taking a class list/avatars and data set with graph parameters (scale/bar widths, axis etc) and plotting the avatars.
Plan is to use matplotlib eg this and this

The idea is to create essentially a bar graph, with with similar scores are stacked on top of eachother in columns - the specifics would be an option in the graph creation logic #16.
This is the rough avatar arrangement I'm imagining*:
Image from http://www.mathblaster.com/coolmath/articles/reading-bar-graphs
So create a graph, iterate over the students/avatars/scores and plot the avatars. Save the image.

*Borrowed from mathblaster.com.

@WrightKD
Copy link

WrightKD commented Oct 4, 2018

I can help with this.

@toonarmycaptain
Copy link
Owner Author

toonarmycaptain commented Oct 4, 2018

Welcome. Sounds great, and thankyou!
Let me know if you have any questions. I don't think anyone's working on the form in which the data will be supplied to image creation logic, so designing this side of that interface first will be helpful to whoever writes the code which passes the data to it. :)

@WrightKD
Copy link

WrightKD commented Oct 6, 2018

This is what I have so far. Is it what you want?
image

@toonarmycaptain
Copy link
Owner Author

Looks good to me. Can it take unique avatars? We don't need the grid behind it, and will mess with the axis, but that's all configurable detail.
My goal is a working prototype, then prettifying it, adding features to supply avatars rather than cleaning and sizing images by hand first (far simpler than automated image rocessing/manipulation, of which I have zero expertise).

@WrightKD
Copy link

WrightKD commented Oct 6, 2018

You can add any image , which for some other reason has to be a .png image , as the avatar. I'm still trying to figure out how to get the axis values correct (I'm also not sure if it must just be a scale from 1 - 10 or what do you need it to be). I do think that resizing the images by hand will be a pain for the user and I think it will not be that difficult to resize an image within the application.
btw I did get a package that converts all given images to .png so that won't be a problem.

@toonarmycaptain
Copy link
Owner Author

PIL should be able to convert images. As for scaling I figure the default would be 0-100% on the x axis, with columns set for 0-9, 10-19...80-89, 90-100, but I also expect to custom scale (eg for a quiz that is out of 15).

There might be an advantage in keeping everything png rather than jpeg, since according to [this SO question(https://stackoverflow.com/questions/46013594/matplotlib-reads-jpg-into-int8-and-png-into-normalized-float) matplotlib does png natively but drops into python for jpg. So converting to png when accepting images, then processing in png (and outputting as jpg only if needed) might be a more efficient and straightforward plan than working with jpgs.

@toonarmycaptain
Copy link
Owner Author

toonarmycaptain commented Oct 14, 2018

@WrightKD How's this going? Can you tell me anything about the interface so I can work on #16 the code for taking data and calling the image creator?

@toonarmycaptain
Copy link
Owner Author

@WrightKD if you're no longer working on this, can you commit what you have, and I'll take it form there?

This was referenced Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants