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

Figanos should rescale logos/images to fit the intended purpose #123

Closed
Zeitsperre opened this issue Oct 11, 2023 · 2 comments · Fixed by #119
Closed

Figanos should rescale logos/images to fit the intended purpose #123

Zeitsperre opened this issue Oct 11, 2023 · 2 comments · Fixed by #119

Comments

@Zeitsperre
Copy link
Contributor

Figanos doesn't use actual scaling; Using zoom will deteriorate the image since it doesn't perform any interpolation (from what I can see in the docs for OffsetImage), but given that it's a PNG, we should be able to scale it down and/or constrain it to a region with Matplotlib (an example of that here: https://stackoverflow.com/questions/16742111/scale-image-in-matplotlib-without-changing-the-axis).

Lowering the logo resolution is a double-edged sword, since maybe it looks fine on monitors or in a notebook, but it'll look bad in print (article, poster) form. This is the exact problem that Seaborn deals with using their set_context() method.

Matplotlib offers lots of ways of interpolating/rescaling images: https://matplotlib.org/stable/api/image_api.html (more if we consider using scipy). Maybe it's worth looking into?

Originally posted by @Zeitsperre in #119 (comment)

@sarahclaude
Copy link
Collaborator

I remember trying a lot of other different ways (like PIL and opencv) to change the logo resolution via python and the logo always came out blurry on the figure that's why I modified it outside code. I don't know if I tried changing it via matplotlib.
Also offsetImage was convenient for the logo position since it didn't require to look at the data (like ax.imshow extend).
I think it would also be better to not have user ponder on image resolution and have a default option (screen) and other options like poster, report,... where we set ourselves the resolutions

@cothel
Copy link

cothel commented Oct 11, 2023

Avez-vous contacté Catherine pour avoir une version plus appropriée du logo (résolution et/ou format) qui fonctionnerait mieux avec Figanos? À condition évidemment de déjà connaitre ce qui fonctionnerait le mieux...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants