moul icon indicating copy to clipboard operation
moul copied to clipboard

Add support for GIF

Open vict0rsch opened this issue 4 years ago • 4 comments

Hey,

thanks for the great work.

can we embed gif images using moul?

Thanks!

vict0rsch avatar Feb 09 '21 23:02 vict0rsch

👋 @vict0rsch currently only jpg and png are supported.

May I know what is your intended use for it?

I think for the most case gif will be better off as video instead. Unless you only need like 2 frames loop.

Cheers!

thasophearak avatar Feb 10 '21 12:02 thasophearak

I like (and need for my usage) the infinite loops ; if that can be reproduced with video players then why not.

In the mean time I had to write a python script to post-process the export and include the gifs I want, you can see section 5 here:

https://cc-ai.github.io/art

vict0rsch avatar Feb 10 '21 13:02 vict0rsch

Ahhh, I can see you point now! for that, it would be nice to have gif support.

I never tried with gif encode/decoder, but to have it support isn't a big changes I guess.

  • Add gif extension in here https://github.com/moulco/moul/blob/master/internal/resize.go#L104
  • Then https://github.com/moulco/moul/blob/master/internal/resize.go#L161-L171 need to change how to resize gif (most likely need to do it for each frame)

I'll add this to the list.

thasophearak avatar Feb 10 '21 15:02 thasophearak

Cool 😎

I expect gif resizing might entail heavy processing (and dev!) times, maybe a v0 could simply handle their native size? Just a suggestion

vict0rsch avatar Feb 10 '21 15:02 vict0rsch