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

Colour reduction algorithm comparison #689

Open
KybernetikGames opened this issue Jul 8, 2020 · 6 comments
Open

Colour reduction algorithm comparison #689

KybernetikGames opened this issue Jul 8, 2020 · 6 comments

Comments

@KybernetikGames
Copy link

I just updated to v2.26.1 and tried out the new colour reduction algorithms and figured I'd give some feedback.

Neural Network says it's good for lots of colours and works reasonably for the main body of the video, but did really badly on the progress bar at the bottom (5 pixels):

neural-network

Octree gave me a smallest file size with a perfect progress bar and the expected colour banding. This is definitely the best one for my purposes.

octree

Saying Median Cut is "less good" is a bit of an understatement. Larger file size, screwed up colours, banding in the progress bar, and horrendous ghosting all in one:

median-cut

Greyscale looks good, but has the largest file size.

greyscale

Most Used Colours is pretty bad too, with poor colouring (as expected) and a different kind of artifacts on the progress bar. But at least it gave the second smallest file size.

most-used

@byzod
Copy link
Contributor

byzod commented Jul 10, 2020

Check the use global color table would help

This should be on by default I'd say, fix many color problem

But even with this on, the light green progress bar is dark green with Neural Network, strange...

This is what I got when capture you second gif (light green bar one with Octree)

Encode with Neural Network, 256 colors, global table, sample 1
Note that the progress bar is obviously darker than original gif, and have a black boarder now
a1

Off topic. Have my thanks @NickeManarin, the new encoder is epic fast and have better performance than before! It's the best overall choice now (before gifski fix the flickring pixel issue :D)

@NickeManarin
Copy link
Owner

This should be on by default I'd say, fix many color problem

I still need to improve the global color palette building mechanism. Right now it only takes the first frame to build the palette.
If a new color appears on any other frame, the color will look off-tone/strange.

But even with this on, the light green progress bar is dark green with Neural Network, strange...

Yes, because the light green color represents a tiny portion of the first frame. Neural takes that into account when deciding which colors to use.

Have my thanks @NickeManarin, the new encoder is epic fast and have better performance than before! It's the best overall choice now

You're welcome! :D

(before gifski fix the flickring pixel issue :D)

I'll take a look if a new version was released or not.

@vatterspun
Copy link

Greyscale looks good, but has the largest file size.

The grayscale issue is something I've seen with other compression tools (e.g. Riot image compression). I don't have any understanding why what seems like fewer colors would take up MORE room, but I never dug into it very far. It does seem like there are fewer things to store without specific colors.

@NickeManarin
Copy link
Owner

@vatterspun The grayscale algorithm creates a global palette (it forces that, ignoring the checkbox) using all color slots available (selected via the "max colors" input).

@vatterspun
Copy link

@vatterspun The grayscale algorithm creates a global palette (it forces that, ignoring the checkbox) using all color slots available (selected via the "max colors" input).

Ah, thanks for that

@byzod
Copy link
Contributor

byzod commented Jul 19, 2020

Tested it more that I found this bug only occurs on new version (2.26)

This is the original gif
t

This is 1.0 encoding (neuquant) of ver 2.23, quality 1
t-2 23-neuquant

This is 2.0 encoding (octree) of ver 2.23
t-2 23-octree

Both of them looks good enough

But things gone wild with new version of StG

This is Neural Network with use global color table of ver 2.26, sample 1
t-g

This is Neural Network without use global color table of ver 2.26, sample 1
t-ng

With global color table there's no color blinking which is good, but the overall color looks weird, especially bright colors (green bar at the bottom becomes dark, it can even be totally black if there are many colors in the image)

Without color table, the color blinks but at least it looks better overall, but strange things may happens on things like progress bar...

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

4 participants