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

Improve in-editor gif recording functionality and performance for non-desktop users #2262

Open
lunahhhhhhhhhhhhhhhh opened this issue Apr 7, 2024 · 3 comments

Comments

@lunahhhhhhhhhhhhhhhh
Copy link

lunahhhhhhhhhhhhhhhh commented Apr 7, 2024

Detailed description of your suggestion

I have noticed some functionality that might be great to add to the in-editor gif recording for those that can't use the ffmpeg-based plugin (web/mobile users);

  • Ability to choose quality when recording gif: the gif recording functionality in the app seems to have been written from a performance standpoint e.g. it uses the lower quality format rgba4444 instead of full quality rgb565 that is available. This makes sense from a performance consideration standpoint, however it would be great to be able to choose quality at the same time when choosing other settings, so if you need a high quality version you can get this. Use of web-workers (as suggested by the gifenc library blockbench is using) would be a great way to reduce the impact of the higher quality on performance. Also the GIFEnc library used appears to implement an algorithm that is geared toward performance, not quality. Could look at implementing a different library such as amazing-gif that uses a different algorithm and bonus is it supports web-workers out of the box.

  • Add dithering option; I have also noted that there is no use of dithering which would be another great option to have. There is a development branch of the gifenc library that adds support for this which we could look at using either by adding a dithering class into Blockbench, making a fork of the library or using the commit as a dependency to include this. Again this has a performance impact, so usage of this with workers if possible would be great

@lunahhhhhhhhhhhhhhhh
Copy link
Author

My own qualms with the current feature are that black areas of a background image go transparent which I attempted to fix here #2259 but also I get flickering in the background image of a gif which I assume is from the algorithim to reduce the color palette as playing with the format/encoding function in screenshot.js didn't help much

@JannisX11
Copy link
Owner

The format is a good catch, I used rgba4444 because I thought it was the only one with alpha support, but it's just the added alpha channel and the other formats work with 1 bit alpha as well.
Switched to rgb565 as the default now since alpha channels aren't fully supported either way.

JannisX11 added a commit that referenced this issue Apr 21, 2024
Change action control to no longer select option under mouse cursor when opening, to improve keyboard ease of use
@lunahhhhhhhhhhhhhhhh
Copy link
Author

Options I have found for making the frames of the animation gif-ready:

  • Using this package image-q
  • Copying the content of pnnquant into blockbench & using its updated functionality not present in the gifenc library

Both of these options don't seem to work with gifenc so it may need to be paired with omggif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants