[GH-ISSUE #689] Colour reduction algorithm comparison #556

Open
opened 2026-02-26 09:31:53 +03:00 by kerem · 6 comments
Owner

Originally created by @KybernetikGames on GitHub (Jul 8, 2020).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/689

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

Originally created by @KybernetikGames on GitHub (Jul 8, 2020). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/689 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](https://user-images.githubusercontent.com/43698611/86872044-cd8d7180-c11e-11ea-89d8-2886f04a2b9b.gif) 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](https://user-images.githubusercontent.com/43698611/86872452-bb600300-c11f-11ea-8deb-814c16383e64.gif) 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](https://user-images.githubusercontent.com/43698611/86872604-17c32280-c120-11ea-9e32-5ab9d15eb30b.gif) Greyscale looks good, but has the largest file size. ![greyscale](https://user-images.githubusercontent.com/43698611/86872731-4b9e4800-c120-11ea-866c-1eb886c4c5ab.gif) 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](https://user-images.githubusercontent.com/43698611/86872837-74264200-c120-11ea-88c1-a406e9311704.gif)
Author
Owner

@byzod commented on GitHub (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)

<!-- gh-comment-id:656629490 --> @byzod commented on GitHub (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](https://user-images.githubusercontent.com/848607/87150977-a339e080-c2e5-11ea-929d-35e81733bcd9.gif) 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)
Author
Owner

@NickeManarin commented on GitHub (Jul 10, 2020):

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.

<!-- gh-comment-id:656709913 --> @NickeManarin commented on GitHub (Jul 10, 2020): > 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.
Author
Owner

@vatterspun commented on GitHub (Jul 12, 2020):

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.

<!-- gh-comment-id:657277911 --> @vatterspun commented on GitHub (Jul 12, 2020): > 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.
Author
Owner

@NickeManarin commented on GitHub (Jul 12, 2020):

@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).

<!-- gh-comment-id:657282356 --> @NickeManarin commented on GitHub (Jul 12, 2020): @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).
Author
Owner

@vatterspun commented on GitHub (Jul 13, 2020):

@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

<!-- gh-comment-id:657300494 --> @vatterspun commented on GitHub (Jul 13, 2020): > @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
Author
Owner

@byzod commented on GitHub (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...

<!-- gh-comment-id:660634364 --> @byzod commented on GitHub (Jul 19, 2020): Tested it more that I found this bug only occurs on new version (2.26) This is the original gif ![t](https://user-images.githubusercontent.com/848607/87874382-fdc8f000-c9fb-11ea-85ee-05c7386de77d.gif) This is 1.0 encoding (neuquant) of `ver 2.23`, quality 1 ![t-2 23-neuquant](https://user-images.githubusercontent.com/848607/87874388-07eaee80-c9fc-11ea-854e-a90afa4c6669.gif) This is 2.0 encoding (octree) of `ver 2.23` ![t-2 23-octree](https://user-images.githubusercontent.com/848607/87874390-0ae5df00-c9fc-11ea-9496-3f3c657e4c57.gif) 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](https://user-images.githubusercontent.com/848607/87874393-0de0cf80-c9fc-11ea-89d4-feddefa1624f.gif) This is Neural Network **without** `use global color table` of `ver 2.26`, sample 1 ![t-ng](https://user-images.githubusercontent.com/848607/87874395-10dbc000-c9fc-11ea-9635-ec3ce8d579ab.gif) 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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#556
No description provided.