nixers
Comparing farbfeld with png and jpeg (farbtest) - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Development & Graphics (https://nixers.net/Forum-Development-Graphics)
+--- Forum: Unix Related Arts & Image Manipulation Software (https://nixers.net/Forum-Unix-Related-Arts-Image-Manipulation-Software)
+--- Thread: Comparing farbfeld with png and jpeg (farbtest) (/Thread-Comparing-farbfeld-with-png-and-jpeg-farbtest)


Comparing farbfeld with png and jpeg (farbtest) - pranomostro - 03-06-2016

This night I had the idea of comparing the new suckless image format farbfeld (http://tools.suckless.org/farbfeld)
with some standard image formats such as png and jpg.

So I conducted a little experiment by writing 2 little scripts and comparing
the compressed farbfeld versions of some images with the originals. The scripts
can be found at https://github.com/pranomostro/farbtest .

Here are the results of my experiment (shamelessly stolen from the README):

A random test with 554 images (467 jpg's, 87 png's) downloaded with 4img was conducted (the images not included because they are nsfw and too big for such a small project). The images were converted to farbfeld and compressed with bzip2 with star2ff.

The data (in case somebody wants it) is in the files png.data and jpg.data.

Only 30 of the farbfeld images derived from png's were bigger than the original file, the biggest ratio being 177%. The rest of the compressed farbfeld images (57) was smaller than the original, values ranging from only 28% of the original size to 99%. Especially very small files and files with a very low entropy were compressed better by farbfeld+bzip2 than by png.

jpg scored a lot worse. Only 1 of the compressed farbfeld's was smaller than it's jpg counterpart, with 99% of the original size. The ratios for the other 466 images were disappointing compared to png's results: 2 farbfeld images were nearly 20 times, most 5-8 times bigger than the original image. The ration increased with the entropy and the number of colors used in the image (mostly white images being comparatively small). This measure should be taken with a grain of salt, because comparing the lossy jpg to the lossless farbfeld could be a bit unfair.

I encourage everyone not to trust these measurements and to test the farbfeld format himself with these small tools and lots of different data sets.

So yeah, that's it.

Hope you enjoyed the information about farbfeld and are as excited as I am about this new lossless image format.


RE: Comparing farbfeld with png and jpeg (farbtest) - z3bra - 04-06-2016

farbfeld is a pretty nice format indeed. I've been involved a bit in the project (I ported the JPG driver from the "imagefile" format to "farbfeld"), and I must say it is a really nice format to play with programatically.

Something should be told about this format though, as we're bringing up the tests. farbfeld always uses 16 bits per channel (RGBA), while PNG might not. For JPG, it only uses 8 bits per channel as far as I know. As it also lower the quality of the image, it is better at creating "patterns" that would allow a better compression. In order to compare FF to JPG, I think you should take a high-res picture (in PNG for example), and convert it to both FF.BZ2 and "lossless" JPG. This way, you'll see which one is the best.

Other than that, good topic! I've personnaly been using FF for quite some time now (got a script to convert all my pictures to FF before viewing it) and I must say I never really wait before seeing an image. Most of the time, it takes longer to download the image than converting it (I use lel as my image viewer).
I also take all my screenshot in FF format with xscreenshot. Now all we need, is wider adoption!