Hi.
Some days ago i saw an image and had the idea to write a compression algorithm that converts the image in a set of gradients. So here is a first preview:
Example
nGI Quality 5/10 Chunk size 8 (35KB):
nGI Quality 0/10 Chunk size 4 (60KB):
JPG (45KB):
(Click to enlarge) (Image made by me)
As you can see, JPG loses every gradient but has a high contrast at the lines and doesn't even get as small as nGI does, but nGI destroys lines and edges.
This example is one of the best, sometimes JPG looks much better than nGI, you can see this in the sample file.
How does this work?
nGI splits the image into a raster of chunks, that are each converted in either a gradient or a surface. The chunk size defines the surface size of the chunks, bigger chunks will result in smaller files but show less details. nGI can show differences between 256 chunk types but there are only 7 implemented (vertical, horizontal, diagonal, backward diagonal, split horizontal, split vertical and surface), so the quality especially at lines will get much better in future.
If you reduce the quality parameter, nGI will use a surface even if there could be a minimal gradient because a surface needs only one color, what results in the half file size.
The lines look this bad because a line can't be described by a gradient and will look blurred. Maybe some of the 249 other gradient types could be used for special line types and improve the quality.
Downloads
Here is a set of demo images with a comparison between nGI, JPG and PNG:
nGI Demo.zip (17,88 MB)
Program to open nGI's (early beta):
ngi_debug_beta.zip (93,89 KB)
Why did i post this?
If you like this codec and it works well, i will continue developing and publish it as a Paint.net file type. Maybe someone also wants to join this project or i could give the source code to the Paint.net developers.
Hope you understood my English and i forgot nothing
How do you like this?