Author Topic: Quality differences between 2 different PNG settings  (Read 225 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7212
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Quality differences between 2 different PNG settings
« on: May 09, 2020, 09:51:25 PM »
I have been testing PNG settings with the two following lines.

    invoke GdipBitmapConvertFormat,pclone,21808h,0,0,NULL,0   ; PixelFormat24bppRGB
    or
    invoke GdipBitmapConvertFormat,pclone,21005h,0,0,NULL,0  ; PixelFormat16bppRGB555

Even after a lot of testing I still cannot see any difference between the 24bpp and the 16bpp versions. The 5*5*5 version is a lot smaller and the quality looks just as good.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

FORTRANS

  • Member
  • *****
  • Posts: 1070
Re: Quality differences between 2 different PNG settings
« Reply #1 on: May 09, 2020, 10:27:54 PM »
Hi,

   Normal images, a bit "busy", will usually look very good
as 16-bit or 15-bit images.  If you want a worst case image
you should try a large smooth gradient from saturated to
black.  That will show some banding.  Mostly things like that
can show up in close-up images of smooth objects.  Others
may have another good example, but I find those to be rare.

Cheers,

Steve

Siekmanski

  • Member
  • *****
  • Posts: 2130
Re: Quality differences between 2 different PNG settings
« Reply #2 on: May 10, 2020, 12:13:10 AM »
PixelFormat16bppRGB555          equ 21005h
PixelFormat16bppRGB565          equ 21006h

16 bit RGB565 will give a better quality than 16 bit RGB555, that's because our eyes are more sensitive for the green color.
Creative coders use backward thinking techniques as a strategy.

jj2007

  • Member
  • *****
  • Posts: 10260
  • Assembler is fun ;-)
    • MasmBasic
Re: Quality differences between 2 different PNG settings
« Reply #3 on: May 10, 2020, 03:26:20 AM »
Full colour PNG is an abuse of the format. Lossy JPG is much better for fotos. 256 colours should be enough for a PNG.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7212
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Quality differences between 2 different PNG settings
« Reply #4 on: May 10, 2020, 07:05:53 AM »
I have yet to find a good reason to use PNG on normal images as JPG just does it better, I mainly use PNG files for transparency with toolbar strips and similar small images for buttons. I have done a lot of testing on the different formats and the 16 bit 5+5+5 format seems to be as good as the 24 bit version but much smaller. I tested the 5+6+5 version but it did not look any better and it was bigger.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

Siekmanski

  • Member
  • *****
  • Posts: 2130
Re: Quality differences between 2 different PNG settings
« Reply #5 on: May 10, 2020, 07:25:39 AM »
The only reason I can think of to use PNG is, when alpha channels are required.
Also color reduction for 2-256 color images with transparency and/or translucency is best done with PNG.
JPG does a much better job if you want opaque, small file size quality images, but it has no alpha channel support.
Creative coders use backward thinking techniques as a strategy.

mineiro

  • Member
  • ****
  • Posts: 577
Re: Quality differences between 2 different PNG settings
« Reply #6 on: May 10, 2020, 08:18:20 AM »
Jpeg is lossy while png is like a gif, lossless.
A photo as an example is better compressed by jpeg, but what you supose to see is what you supose to get.
With png what you see is what you get.
Not ever jpg is better than png,gif,bmp. An example; open an image editor and fullfill the area with a collor, save using both formats and compare. We know that RLE,dictionary compress better in this case and this is the point. If image have a lot of collors variations so jpeg can win because is not trustworthy.
Have a jpg format thats lossless but few use that.
So it depends on the image/data and not the format, also for compressors, some are better than others in certain cases.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

mineiro

  • Member
  • ****
  • Posts: 577
Re: Quality differences between 2 different PNG settings
« Reply #7 on: May 10, 2020, 08:36:21 AM »
that's because our eyes are more sensitive for the green color.
Some persons say that sun color is green; we look as yellow/orange because sky is blue.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

daydreamer

  • Member
  • *****
  • Posts: 1217
  • I also want a stargate
Re: Quality differences between 2 different PNG settings
« Reply #8 on: May 10, 2020, 09:20:30 PM »
Jpeg is lossy while png is like a gif, lossless.
A photo as an example is better compressed by jpeg, but what you supose to see is what you supose to get.
With png what you see is what you get.
Not ever jpg is better than png,gif,bmp. An example; open an image editor and fullfill the area with a collor, save using both formats and compare. We know that RLE,dictionary compress better in this case and this is the point. If image have a lot of collors variations so jpeg can win because is not trustworthy.
Have a jpg format thats lossless but few use that.
So it depends on the image/data and not the format, also for compressors, some are better than others in certain cases.
but gif and PNG uses more modern dictionary compress,maybe combined with RLE so only RLE works in special cases
I learned the hard way jpgs lossy compression,when try raycasting on jpg map didnt work,because the pixels fluxuated between 252-255(original color 255) something when I examined it afterwards
one reason I am interested in RLE,is make a map in paint program and save in RLE and use the compressed RLE data directly in something like raycasting,might become faster to read in how many empty squares it is to a wall,than to scan many empty squares

fast animation is best place for lower level quality,because eyes doesnt spot very detailed things in motion

 
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

mineiro

  • Member
  • ****
  • Posts: 577
Re: Quality differences between 2 different PNG settings
« Reply #9 on: May 10, 2020, 09:45:12 PM »
hello sir daydreamer;
Yes, the same goes for mp3. A musician with good hearing can see that a certain musical note has been cut into a certain song.
I saw a video of a pianist who wanted to ask the subscribers if they could tell the difference between 438hz and 440hertz. In the comments everyone said no. It was the compression used on youtube that brought about this fact.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything