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

A couple real-world non working images #55

Open
mscheltienne opened this issue Sep 28, 2021 · 4 comments
Open

A couple real-world non working images #55

mscheltienne opened this issue Sep 28, 2021 · 4 comments

Comments

@mscheltienne
Copy link

mscheltienne commented Sep 28, 2021

Hello,

I just found out about folderify and really liked the idea!
However, it can get quite frustrating as it is very hard to figure out which mask will generate a nice-looking folder icon and which mask will generate a folder icon with a square/rectangle inside.
It took me about 10 different, absolutely similarly looking images, to find one that works for the MATLab logo:
https://www.google.com/search?q=icon+logo+matlab&client=firefox-b-d&sxsrf=AOaemvKCOv_7Hx6yEml2TZU53AOL_3sr8g:1632838569283&source=lnms&tbm=isch&sa=X&ved=2ahUKEwirrZbX7aHzAhWcgf0HHZOpB2YQ_AUoAXoECAEQAw&biw=1920&bih=977&dpr=1

I also could not find one working for Zotero logo and for FCBG logo.
Getting those to works could be a good general improvement for a larger base of image ;)

Here are a couple of examples of non-working images:

zotero1
zotero2
zotero3
zotero4
zotero5
fcbg1
fcbg2
fcbg3
neurotin

@lgarron
Copy link
Owner

lgarron commented Oct 2, 2021

How familiar are you with image masks and image compression?

Example

Like in the example, the simplest way to get results is to have a PNG with a black shape on a transparent background.
folderify will ask ImageMagick will do its best to take background color from the corners and turn it transparent across the image — but that will not work well if there are compression artifacts, which is common with JPEG images. It also definitely won't be able to handle a checkered background that is part of the image itself.

If you're having trouble finding good source images, I would suggest using Krita's Color to Alpha feature to create the transparent background that you want, and save as PNG:

For example:
Screen Shot 2021-10-01 at 18 34 46

icon_512x512@2x

It looks like there are some online tools that could also give you reasonable results, like https://onlinepngtools.com/create-transparent-png
But generally I've only trusted GIMP/Glimpse and Krita to do this well.


Unfortunately, I don't think folderify can reasonably guess what everyone will want, and in a lot of situations it can't even come close without significantly changing the scope of folderify. I think your 3D-ish Zotero pictures are a good example: Even after removing the checkered background (which would be tricky to do automatically) and excluding the possibility of using the full logo hexagon as a mask, I think there are at least three reasonable interpretations of which major shapes should be part of the mask, all of which require figuring out where to cut off the fuzzy bottom reflection of the Z:

Screen Shot 2021-10-01 at 18 46 51

In addition, it would probably also make sense to use only the 2D "front face" of the Z and move it up to center it in the hexagon. And if you went for the middle option, I think you'd also want to make the hexagonal border thicker (while preserving crisp lines).

So I don't think any practical code change would help you very much. But I could make a short tutorial on masks and link it from the README.md if that would help.

Please let me know if this helps!

@mscheltienne
Copy link
Author

Indeed I am not very familiar with mask and image compression.
After reading the tips in the readme, my take was:

  • Use a .png mask.
  • Use a solid black design over a transparent background.

Even then, the output was not always consistent (Especially the MatLab logo, but I did not save the failing images..).
The checker background is an addition by the Download/Upload roundtrip. Those images had a transparent background instead of a unicolor (white) background, which is why I found it weird that they were failing.

The suggestion and example on Krita useful tool was great. IMO it would be a good addition to the readme.

Additionally, how about adding a GUI-like feature with a preview and some basic image manipulation operations? This would probably be a lot of work, but also a good addition.

@lgarron lgarron reopened this Jan 20, 2022
@lgarron
Copy link
Owner

lgarron commented Jan 20, 2022

Hope you don't mind if I keep this open until I get around to a vid. :-D

@mscheltienne
Copy link
Author

Sure, I thought it was more or less abandoned and I wanted to clean my open issues. Looking forward to a vid 😄

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

No branches or pull requests

2 participants