JPG or PNG Textures?
-
Hi Everybody,
This may be a question I already know the answer to but just to get the facts straight. Is there a ( large ) difference between the quality of textures when rendering if you use png instead of jpeg? I was wondering because I'm working on a architectural scene where the concrete of the building is its main feature. I want the concrete the be at its best so I'm struggling with max texture size ( resolution ) and png or jpg. Hope somebody can help me on this one.
Greetz Twan
-
It depends.
It depends on how high the JPEG compression is.
And it depends on what type of textures it is.PNG is a safe format - since it's lossless.
JPEG will loose some quality when saving. If you set the quality too low it'll end up blurring. -
png allows you to benefit from the use of the alpha channel - in other words you can draw transparent and semi-transparent areas inside the some texture or even a transparent gradient.
for a concrete wall or ceiling png is as good as a jpg with a low compression.
-
.jpg also will ALWAYS lose some data. If you save it on the highest quality setting over and over, it will degrade a little bit each time. So if you are saving out of photoshop, then into and out of the SU model, then re-photoshopping, then continuously re-adjusting, it will lose more and more quality.
A .png will never lose quality through that process (in theory anyhow).Chris
-
Thanx for clearing this up for me . Hope to post a render of the scene soon.
Greetz Twan
-
@unknownuser said:
jpg with no compression
You mean you set the quality to high?@unknownuser said:
It is my guess that the application saving the data is leaking and not the jpg itself.
No - JPEG's lose quality due to the nature of the compression algorithm it uses. JPEG can take near-similar parts of the image and reuse it. PNG doesn't - it preserves each pixel.
In your test - did you change anything in your image when you re-saved it? Or did you save an image identical to the one you opened?
-
JPEG is by definition a lossy format. Formats such as BMP,TGA,PNG are lossless.
However, it is also true that if the color gamut of the image you're saving is sufficiently small, you'll get almost no loss using JPEG at highest quality. So a largely grey concrete texture may well be fine. A photo with a larger range of colors absolutely will show loss using JPEG. Nothing to do with dodgy Apps losing data.
If you're concerned about loss of quality and you have the disk space, there is no question that you should use a lossless format that stores the exact pixel values one after another in a file. But if you're dealing with a 4000x4000 pixel image, thats 64MB of data. I'd guess JPEG - with neglible quality loss - would be able to store it in 10% of that space.
Adam
-
@unknownuser said:
I have often wondered how a jpg with no compression loses data when it is saved. I am not sure that is the case. The fine pixel below has a set of original pixels on the left and the same set on the right after ten saves, both from a much larger image. Each time the new image has been saved, opened, then re-saved. This is not an elaborate test but as you can see if there is data loss I don't see it. It is my guess that the application saving the data is leaking and not the jpg itself.
Its a bit of an unfortunate choice of image because JPEG compression works by breaking out chroma and luma and storing less resolution for chroma than luma. (I appreciate concrete is mostly grey). Hence you will see color shifting of pixels as JPEG compression increases - typically grays become a little pink for example.
-
I have use jpg for most of my work because it appeared to be a generally accepted standard. Posted here are more reasons to use png then jpg, but there must be good reasons to use jpg. Anyone care to illuminate?
Based on this discussion, while editing, I will hereafter work with png, only going to jpg with the final image.
-
jpg is used so widely because it compresses so well. jpg has been around for a long time - back when file size was king. Remember how painful it was to download a large image on an old 2400baud modem, or even worse a 300baud modem? So compression was important. And I think jpgs just have not lost their popularity yet. I try to use png in the office when I can.
-
If you use greyscale images (with the colorize function in sketchup) then PNG's are the clear victor in compression as you can specify how many colors you wish to use, dither, etc.
For images that have more than 256 colors the file size tends to be in JPEG's favor.
The best thing about PNG is continuous-tone(256 shades) transparency.
Best,
Jason.
Advertisement