Click here to Skip to main content
15,910,083 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Slides, photography from the 50's??? Pin
W Balboos, GHB4-Jun-20 6:06
W Balboos, GHB4-Jun-20 6:06 
GeneralRe: Slides, photography from the 50's??? Pin
glennPattonWork34-Jun-20 6:54
professionalglennPattonWork34-Jun-20 6:54 
GeneralRe: Slides, photography from the 50's??? Pin
Mike Hankey4-Jun-20 6:17
mveMike Hankey4-Jun-20 6:17 
GeneralRe: Slides, photography from the 50's??? Pin
OriginalGriff4-Jun-20 6:32
mveOriginalGriff4-Jun-20 6:32 
GeneralRe: Slides, photography from the 50's??? Pin
glennPattonWork34-Jun-20 6:56
professionalglennPattonWork34-Jun-20 6:56 
GeneralRe: Slides, photography from the 50's??? Pin
kalberts4-Jun-20 7:39
kalberts4-Jun-20 7:39 
GeneralRe: Slides, photography from the 50's??? Pin
Gary R. Wheeler4-Jun-20 13:11
Gary R. Wheeler4-Jun-20 13:11 
GeneralRe: Slides, photography from the 50's??? Pin
kalberts4-Jun-20 7:37
kalberts4-Jun-20 7:37 
You shouldn't pack-unpack-pack-unpack too many times, especially if you have set the quality low to minimize the size of the JPEG file.

But then again: Some people judge the quality of compression (whether photos, video or sound) solely based on the file size - disregading both the software creating the file, and the method used, taking for granted that bigger file = better quality. For "natural" shapes, JPEG is actually quite good.

Note one very important thing about JPEG (that also holds for MP3 and AAC audio and MPEG/H.26x video): Compression is not standardized. Decompression is! Two JPEG files may contain very different data streams, both decompressing to very similar expanded images. Two compressors may use very different strategies for creating a data stream that will decompress to the desired result. Simple software just find "something that works"; more advanced software may try out different alternatives, do the decompessing and see how much it differs from the uncompressed input image, and select the encoding that minimises the differences. Or set parameters to reduce losses below a given treshold.

The basic idea of JPEG is that with a point light source illuminating a flat surface, the brightness will vary over the surface by a cosine function. With a distant, "flat" light source like the sun, a spherical surface will receive ligth varying with the cosine of the angle between the light source and the surface normal. A matte (non-blank) surface reflects light in given direction as a cosine function of the angle to the direction of the light. An opaque material, such as a white lamp dome, spreads light in a similar way.

So, cosine distriubtions are very common. A photo of a smooth ball illuminated by a point source (or by flat light) could in theory be reduces to a handful of number describing the intensity and color of the light source, the size and reflectivity of the ball. These numbers are what a JPEG compressor strives to find.

Photos of smooth balls are not that common, so the image is split into quite small squares that "locally" is like a section of a close-to-spherical surface. The first approximation is to assume that it is part of a sphere, and determine, from the distribution of tones, the radius and a possible light source. For e.g. cheek sections of a portrait, even the first try may come very close to the input image. In other sections, like around the eyes, lips etc., the compressor must select the most dominant spherical surface, and then add another surface the same way, so that when the two are added, they come closer to the original. To get even closer, a third elmemnt can be added, a forth, and so on. If you end up with a discrepancy from the original less that the value of the least significant bit (i.e. if the pixel value are integers from 0 to e.g. 2**8 and the packed and unpacked values differ by less than 0.5), you are actually loosing nothing, yet the series required to represent this may be more compact than raw encoding of every pixel.

If a picture contains elements far from natural cosine-friendly curvatures, but e.g. have lots of sharp transitions, then you must continue that series with many elements to reduce the discrepancies. But a good compressor will do that only in those parts where it is required: "Easy" picture parts receive only a small part of the bit budget, to leave more for the difficult parts. It could lead to e.g. the cheek being slightly smoother than in the original image, to make the text parts sharper.

Note that JPEG in fact tries to describe a limited-pixel-resolution image using continous functions over those square picture fragments. If it succeeds, with sufficientl small artifacts, it has in fact recreated an analog, resolution independent model of each fragment, that could in principle be resampled in any resolution before display (assuming that the resampling is done directly on the cosine functions, not on the unpacked raster image).

So, while it is advisable to use an uncompressed format while editing and adjusting the photo, you should not "be afraid of" JPEG as the final format when all work is done - provided that you use a high quality compressor. Lots of people who insist on lossless formats, whether sound or image, fail miserably in blindfold tests where they do not know anything about the file size, method used etc. and are limited to watching the images at a normal viewing distance, without using a magnifier, and without doing a diff between two images. Even if that is granted them, they may be unable to tell which is the original and which is "ruined by compression artifacts".
GeneralRe: Slides, photography from the 50's??? Pin
Peltier Cooler5-Jun-20 4:02
professionalPeltier Cooler5-Jun-20 4:02 
GeneralRe: Slides, photography from the 50's??? Pin
Rick York4-Jun-20 9:12
mveRick York4-Jun-20 9:12 
GeneralRe: Slides, photography from the 50's??? Pin
kalberts4-Jun-20 6:33
kalberts4-Jun-20 6:33 
GeneralRe: Slides, photography from the 50's??? Pin
den2k884-Jun-20 7:00
professionalden2k884-Jun-20 7:00 
GeneralRe: Slides, photography from the 50's??? Pin
glennPattonWork34-Jun-20 7:02
professionalglennPattonWork34-Jun-20 7:02 
GeneralRe: Slides, photography from the 50's??? Pin
kalberts4-Jun-20 7:48
kalberts4-Jun-20 7:48 
GeneralRe: Slides, photography from the 50's??? Pin
glennPattonWork34-Jun-20 12:23
professionalglennPattonWork34-Jun-20 12:23 
GeneralRe: Slides, photography from the 50's??? Pin
kalberts4-Jun-20 19:21
kalberts4-Jun-20 19:21 
GeneralRe: Slides, photography from the 50's??? Pin
davecasdf5-Jun-20 4:39
davecasdf5-Jun-20 4:39 
GeneralRe: Slides, photography from the 50's??? Pin
den2k884-Jun-20 6:55
professionalden2k884-Jun-20 6:55 
GeneralRe: Slides, photography from the 50's??? Pin
glennPattonWork34-Jun-20 7:04
professionalglennPattonWork34-Jun-20 7:04 
GeneralRe: Slides, photography from the 50's??? Pin
RickZeeland4-Jun-20 7:44
mveRickZeeland4-Jun-20 7:44 
GeneralRe: Slides, photography from the 50's??? Pin
DJ van Wyk4-Jun-20 20:43
professionalDJ van Wyk4-Jun-20 20:43 
GeneralRe: Slides, photography from the 50's??? Pin
User 43550444-Jun-20 21:13
User 43550444-Jun-20 21:13 
GeneralRe: Slides, photography from the 50's??? Pin
lucien644-Jun-20 23:30
professionallucien644-Jun-20 23:30 
GeneralRe: Slides, photography from the 50's??? Pin
Matthew Wilson5-Jun-20 2:07
Matthew Wilson5-Jun-20 2:07 
GeneralRe: Slides, photography from the 50's??? Pin
bleahy485-Jun-20 5:54
bleahy485-Jun-20 5:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.