eylles / pywal16

16 colors fork of pywal
MIT License
157 stars 24 forks source link

[Unsure]: Color generation for gif. #39

Closed niksingh710 closed 4 months ago

niksingh710 commented 4 months ago

i tried wal with a gif and magick took full cpu for around 1 min. I want to ask does it try to extract color from every frame? if it is the case then it will be nice to have a flag that specifies which frame to use to generate the color if it is a gif.

eylles commented 4 months ago

yes, imagemagick tries to extract colors from every frame, mind you that wal is the only backend i'm sure supports gif due to imagemagick, the others may or may not, and the ones that do likely use frame 0, i could make a default to use frame 0 for every image (imagemagick is smart enough to know that static images only got frame 0) and add a flag to specify frame, tho that will need some testing to ensure nothing dumb will happen.

niksingh710 commented 4 months ago

ig the final output that wal gives by using imagemagick is the colors from the last frame of the gif. earlier i had an script that used to extract first frame if the image is an gif and then feed it to pywal so that i can have a blurred version of it also. had not faced any bug in that ever.

eylles commented 4 months ago

huh weird, for all intents and purposes pywal16 should already be using only the first frame of a gif as the "[0]" identifier for the first frame is appended to the image name in the command on here:

https://github.com/eylles/pywal16/blob/master/pywal/backends/wal.py#L14-L18 https://github.com/eylles/pywal16/blob/1ebea0bb61434dcb5787ed2bb48ddf49133b7d11/pywal/backends/wal.py#L14-L18

eylles commented 4 months ago

hmmm, tested with some gifs and it works for me.

niksingh710 commented 4 months ago

yep works fine here. (it was from wal-telegram for me and i thought it was caused by pywal) switched to walogram and added if clause for gif's https://github.com/niksingh710/gdots/blob/master/bin/after-wal#L176-L181

https://github.com/niksingh710/gdots/blob/master/bin/after-wal#L141

eylles commented 4 months ago

ah that makes sense, i think that for telegram using bash really is a stretch, and rust seems like overengineering for this kinda simple color generation programs so i do plan to make a rewrite of wal-telegram in python.