The most high quality GIF

For everything that's not in any way related to PureBasic. General chat etc...
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

The most high quality GIF

Post by walbus »

The most high quality GIF

Looking cool :)
http://i.imgur.com/RFN3bc9.gif
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: The most high quality GIF

Post by Keya »

the quality is helped by being based on smooth CGI images, and the quantizer is of good quality, but it's still only 255 colors so it's probably not "the most high quality GIF". I think that category is probably reserved for GIF's that use a design trick: tiling subimages onto the main image, each preceded by their own color table, which allows for a GIF image with more than 256 colors. Not all renderers show them properly, but i find it an interesting trick:
Image
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: The most high quality GIF

Post by netmaestro »

Yes I remember having a bit of trouble with that one when I was writing my decoder. It's mainly about getting the disposal method right iirc. Interestingly enough though, you can achieve close to that quality with one frame using a neural network to generate the color table.
BERESHEIT
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: The most high quality GIF

Post by Keya »

why neural network as opposed to a clustering algo?
[edit] ooh, Neuquant :) ive actually gotten better (slightly - not much room for improvement) results from kmeans++, but Neuquant always a close 2nd for 256 color images, it's very impressive at that level. Neuquant starts to lose ground to a variety of other algorithms though when quantizing to more than 256 colors, at least according to my tests with PSNR, MSE and image quality metrics like SSIM but not a huge sample size
Last edited by Keya on Sun Feb 05, 2017 8:14 am, edited 1 time in total.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: The most high quality GIF

Post by netmaestro »

Mainly because I've experienced better quality with Dekker's NeuQuant than anything else I've tried. Here's a single-frame 256-color gif with the colortable created from a .png screenshot of your posted gif (when the lines and stuff were all gone) The colortable was generated using Wilbert's port of NeuQuant:

Image
BERESHEIT
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: The most high quality GIF

Post by Keya »

i cant do a fair comparison with yours because yours is upscaled to 260x260 but the original image is only 210x210 and we might not be using the same upscaling algorithms

Doing a test now. btw original is https://upload.wikimedia.org/wikipedia/ ... olours.png (bit better quality anyway :)
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: The most high quality GIF

Post by netmaestro »

So sorry about that, my mistake. I made a new one from a png the right size, it's updated. I'd be interested to see/hear the results of comparisons with other algorithms, for sure.
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: The most high quality GIF

Post by netmaestro »

Saw your edit and created the gif from the png in that link. Posted gif is updated, you should be able to do a fair comparison now.
BERESHEIT
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: The most high quality GIF

Post by Keya »

my results:

Code: Select all

KMeans++   MSE=2.655404384   RMSE=1.6295411575
KMeans     MSE=4.1429251701  RMSE=2.0354176893
Neuquant   MSE=6.294452003   RMSE=2.5088746487
Octree     MSE=7.8999017385  RMSE=2.8106763845
for kmeans++ see JHP²'s OpenCV-for-PB :) http://www.purebasic.fr/english/viewtop ... 12&t=57457
use #KMEANS_PP_CENTERS to ensure it uses the kmeans++ initializer (starts with better centroids), otherwise it's just kmeans. Ive got a lot of quantizers in my toolkit now but i think only Neuquant uses neural network, interesting and fairly effective approach
Post Reply