Topic: [Feedback wanted] I made a help page about Image Quality

Posted under Tag/Wiki Projects and Questions

[Link to the wiki page] | [Link to the help page]

This comes up regularly so I figured I'd make a help page so we have something we can link to people, which will hopefully help people figure out why we sometimes keep smaller PNG files, delete bigger jpg files, or delete upscales, etc. etc.

Please let me know what you think of this page. Is it concise enough? Is it easy enough to understand for someone not tech-savy? Is the tutorial clear enough (even for beginners)? Are there any parts missing?

Updated by savageorange

A common confusion that users may have is that because their art is of high quality - in the sense of the factors listed on this page - that it should be accepted.

I foresee that this page will be used by confused and angry users who have had their images deleted for not meeting quality standards, as a sort of "look, I did everything on the page, why was my art deleted!?!?"

I suggest that these pages include a distinction between technical quality, as is described on that page, and artistic quality, such that users can see that these are not the only standards used when judging whether or not a particular piece will stay (rather than this, which only applies to comparisons between two versions).

Otherwise I think it is fairly well done.

Updated by anonymous

Great wiki page! Here are some changes I would make. Feel free to copy them (warning: LONG!)

What is JPEG and why is it bad?

The JPEG (jpg) format started development in 1986 and standardised in 1992 to allow digital photographs to be stored on computers back when computers had very little hard drive space. JPEG works by using complex mathematics to carefully remove many details of the image that we usually don’t notice at first to allow the image to be smaller. Depending on the amount of JPEG compression used, the image may only degrade very slightly or it may degrade very noticeably. JPEG works great for photos because photos are extremely complex and also contain a lot of data that we can’t really make use of, and with modern cameras taking pictures at very high resolutions, the compromises JPEG makes are even less noticeable.

So why is JPEG so bad at compressing art? The answer is that no matter how detailed a piece of art is, it will never contain the amount of differences between pixels that a photo has and is most often not as high resolution. As a result JPEG’s compression is very easy to notice. You may notice that colours become duller (especially red), square artefacts show up (that’s called macroblocking), gradients appear broken up (banding), and/or the image becomes less sharp. Browse through the tag compression_artifacts and you’ll notice why JPEG is bad for art and why e621 deletes JPEGs when a higher quality option (e.g. PNG) is uploaded.

What is PNG and why is it good?

PNG started development in 1995 and was standardised in 1996, originally to be an improved, patent-free replacement for GIF for still images. PNG supports up to 64-bit colour (48-bit when compressed) and supports proper alpha channel transparency: GIF only supports 8-bit colour and non-variable transparency. (JPEG doesn’t support transparency at all because it was designed for photos.)

PNG is either uncompressed or it uses lossless compression. As the name suggests, it does not throw away any data. As explained before, JPEG compression works by using mathematics to throw away data a photograph doesn’t necessarily need. PNG compression instead uses mathematics to pack the image into a smaller space without throwing anything away, and then unpacks it when you open it. Compressing PNGs with higher amounts of compression only makes the file smaller and requires more CPU power to compress and uncompress. In comparison, compressing a JPEG more means throwing away more data and ending up with a lower quality image. PNG stays the same no matter how much it is compressed.

Note: converting or re-saving a JPG to a PNG will not magically improve the image quality. When an image is saved as JPEG the computer has already thrown away data, and that data cannot be recovered. Saving a JPEG as a PNG simply saves the JPEG in exactly the same state that it was already in.

Also, some websites lie about the format the image is in. FurAffinity is most notable for this: often a PNG is uploaded to FurAffinity and their servers automatically compress a PNG larger than 1280x1280 into a JPG, but for some reason they don’t automatically change the file extension from PNG to JPG.

In summary, a PNG is an exact representation of what the artist created no matter how much it’s compressed, making it ideal for art.

What about GIF?

GIF was created in 1987 to be an online image format. It supports only 256 colours and non-variable transparency. The one thing GIF does that other formats don’t do is animation. Although PNG has been extended into APNG to allow animation, that format is not in widespread use.

Although GIF is technically a lossless format, using the once patented LZW compression method, the main problem with GIF is that it only supports 256 colours. For the most part, this is solved through the use of a process called dithering, where colours are arranged in special patterns to better recreate the original image. Unfortunately the low colour support is still an issue no matter how good the dithering is - images can only be dithered so much with only 256 colours available.

On top of that, GIF is much less efficient at compressing. For small animations, this doesn’t really matter, but longer animations will have a very large filesize. The solution for this is always a compromise, usually lowering the frame rate, lowering the resolution, or even just cutting the animation short. Because of this, it is recommended to compress longer animations into a video file (typically MP4 or WebM). That said, shorter animations will also benefit from being compressed into a video file, because video files don’t have any of the limitations of GIF.

What are your thoughts? I hope what I wrote was good! :D

Updated by anonymous

Q1

I don't know the below cases' standard:

case 1:

name resolution size
1496542.jpg 3118x3000 609KB
1496542-2.png 1200x1155 1.09MB

CW-SSIM: 0.9908747

case2:

name resolution size
764152.jpg 907x1280 200KB
764152-2.png 645x911 702KB

CW-SSIM: 0.9783403

I downsample the high-res image to match the low-res one (Is it a right way to do?)

and followed the "Tutorial on how to compare images" in help page

Below link contains the original images and differenced images

files(#NSFW)

Q2

I know two same images with different sizes , their image qualities may be the same. (ex. my deleted post )

So after comparing the files sizes, I should followed the "Tutorial on how to compare images" in help page

But sometimes it is hard to judge , due to the screen, eye limit, or eye strain

Here's the case:

93.2 KB (95,480 bytes) v.s. 93.2 KB (95,526 bytes)

First, I followed the tutorial and get the mostly black image

and I use program to check that image, it is not pure black ( my deleted post black image is pure black )

Then I used SSIM to compare them , the result is 0.9999561 , not equal to 1

I checked my deleted post , SSIM is 1

So if the image size is bigger than the post on e621 and their SSIM is not equal to 1, (and same image type, ex:jpg, and same resolution)

Can I reupload the post?

Or recommend other algorithms or approaches?

Updated by anonymous

darkazma said:

Here's the case:

93.2 KB (95,480 bytes) v.s. 93.2 KB (95,526 bytes)

Then I used SSIM to compare them , the result is 0.9999561 , not equal to 1

I checked my deleted post , SSIM is 1

So if the image size is bigger than the post on e621 and their SSIM is not equal to 1, (and same image type, ex:jpg)

Can I reupload the post?

Or recommend other algorithms or approaches?

For a few bytes? No.

Updated by anonymous

AoBird said:
For a few bytes? No.

Filesize. Is. Irrelevant.

darkazma said:
bunch of text

1496542-2.png

is JPG resaved as PNG, you should see JPG compression clearly. 1496542.jpg is preferred as it's higher quality, higher resolution and no funky stuff with filetype.
764152.jpg is only ever so slightly higher resolution, but 764152-2.png is lossless, so added resolution doesn't justify details lost with compression, so PNG is preferred.

When the resolution between two images is differend, then you shouldn't compare differenciation as downscaling will effect image quality and it can change depending on integrer and what downscaling method you used (nearest neighbor, bilinear, lanczos, etc.). With two differend sized images you should simply compare manually with eye. If you have problems, simply use zoom, image editors really commonly have nearest neighbor zoom which makes it even easier while browsers usually apply filtering to zoom.

With post #843349, there's difference, but we are nearing the point where it's first of all impossible to determine which version is the superior one (effected areas are on white so they look visually identical) and when the difference amount is 0.0001% it becomes nitpicking so usually that's in the area where it's ruled identical, even if on paper it's not 1:1 identical. Keep common sense in the game, even if sometimes the difference on replaced posts are low.

Updated by anonymous

So below are the solutions to different cases

Please tell me which parts are wrong or fine.

Below links' images are NSFW.

Same type, Same resolution, Different size

case 1
name resolution size
A.jpg 1000x1000 100KB
B.jpg 1000x1000 200KB

if the image has not been uploaded, choose the biggest size

else, check their differenced image,

> if you can see the slightly colored outlines in it, then you can reupload it.

> if you cannot see the slightly colored outlines, then don't reupload it.

Different type, Same resolution, Different size

case 2
name resolution size
A.jpg 1000x1000 100KB
B.png 1000x1000 200KB

(?)Same as above

Same type, Different resolution, Different size

case 3
name resolution size
A.jpg 1000x1000 100KB
B.jpg 1010x1010 105KB

(?)compare two images by eyes ( zoom in )

Different type, Different resolution, Different size

case 4
name resolution size
A.jpg 1000x1000 100KB
B.png 1050x1050 200KB

case 5
name resolution size
A.jpg 1000x1000 100KB
B.png 500x500 200KB

for case 4 and case 5, both of them need to compare two images by eyes ( zoom in )

but in case 4, I thought B mostly wins.

Edited:above images are all from artist's websites, and two images' SSIM > 0.9 but not equal to 1

Updated by anonymous

darkazma said:

Same type, Same resolution, Different size

case 1
name resolution size
A.jpg 1000x1000 100KB
B.jpg 1000x1000 200KB

if the image has not been uploaded, choose the biggest size

You seem to have missed this part in Mairo's explanation so let me just reiterate this:

File size doesn't matter. Period.

Always check the files manually, and if in doubt go with the best looking original version directly from one of the artist's galleries.

File size is literally never a good indicator of quality because it's possible to inflate it with bogus-data.

Updated by anonymous

Saving PNGs with different compression levels (eg 2 vs 9) can also result in files of a notably different filesize (without any bogus data), that are still pixel-for-pixel identical.

Updated by anonymous

  • 1