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

Image effect (GIF support) #3835

Open
wants to merge 10 commits into
base: 0_15
Choose a base branch
from
Open

Image effect (GIF support) #3835

wants to merge 10 commits into from

Conversation

Aircoookie
Copy link
Owner

A very versatile advanced effect mode for displaying .gif images (could be extended to other filetypes like .bmp or .fseq in the future) on matrices and 1D strips.

  • full animation and static image support
  • upload GIF to LittleFS (/edit) and set the filename as the segment name
  • speed is adjustable

Limitations

  • the effect can only be used on one segment at a time
  • no image is displayed during effect transitions
  • As 23kB RAM are required while the effect is running, this is ESP32 only
  • each animation frame only redraws the pixels that are actually updated. This can lead to uneven brightness if ABL kicks in. I highly recommend enabling global buffer to solve this :)

@Aircoookie Aircoookie marked this pull request as ready for review March 20, 2024 07:40
@blazoncek
Copy link
Collaborator

Now we will really need to start working on SD card support. 😄

@blazoncek
Copy link
Collaborator

blazoncek commented Mar 20, 2024

Is the removal of mqtt.cpp intentional or accidental?
Eh! Disregard. I see that entire file was changed. Probably CRLF.

@constant-flow
Copy link
Contributor

Now we will really need to start working on SD card support. 😄

SD support is already implemented and merged as usermod

@blazoncek blazoncek linked an issue Mar 24, 2024 that may be closed by this pull request
@blazoncek
Copy link
Collaborator

Finally had a bit of time to go through the code. Sorry for the delay.

There are a few of Serial.print() still present but that's minor.
I am a bit intrigued by the addition of endImagePlayback(this); into resetIfRequired(). That is something we need to add to Segment handling in general as the effect functions never receive any notification that they will no longer run and cannot clean-up anything. Everything now relies on deallocateData() which is a bit of shame really.
I would also move the content of renderImageToSegment() into mode_image() as it is more "tightly" connected to actual Segments. Perhaps the entire image_loader.cpp could be encapsulated within a class inside mode_image() in a similar way as 1D expansion is done.

@Aircoookie
Copy link
Owner Author

Thanks!
Yeah, I don't like endImagePlayback() in resetIfRequired() either. It would probably be a good idea to add some callback for cleanup when effect is changed. To avoid requiring an extra 4 bytes for the pointer in each segment, this could also just call the mode function with a bool parameter cleanup though.
Regarding image_loader.cpp, I would keep it this way. FX.cpp is already over 8k lines and putting functionality into separate files when it makes sense eases maintainability imo.

@dosipod
Copy link

dosipod commented Jun 6, 2024

We have been testing this branch a lot as that is a door for a very simple way to create custom effects even if that is not the intended purpose

custom_fx2

So that is why we think that gifs could be a way to enhance wled even in ways no one thought of .The size at the moment is a show stopper without at least SD card support being linked to that as we could only load few small gifs in our tests .
For a while now we have been testing a usermod that has a gif client and a server ( public and private )
https://github.com/hughc/wled-pixelart-client https://github.com/hughc/pixel-art-server

If @Aircoookie is no longer interested in this ( this is more alarming in a lot of ways which is not related to gifs as your presence is a motivation to a lot of the guys) then we want to try to borrow the logic from the usermod to simplify the gifs loading either from a shared SMB folder on a local PC or a folder on github without the use of any code on a server just to make that more user friendly as much as possible which we are not sure of at this point . ( We work with students on a variety of projects and we are not wled devs and do not wish to do something others may have in mind or planned in a more polished way but we will give it a shot ) . Hope you get the point

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 this pull request may close these issues.

gif support
4 participants