The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

59

I was a beginner at the time, took this picture of a very nice sunset. I was pretty disapointed by the picture... Once I learned how to properly use Lightroom, I was able to get most of the details back from the original RAW file to get it to what I was really seeing in real life.


55

This is based on a misunderstanding. Loss of quality happens only during the compression that is done when an image is saved as JPEG. But it doesn't matter whether it was edited or not. So: you will (with some very specific exceptions, see comments) lose quality if you open an image in an image editor and re-save it, even if you didn't make any edits. But ...


37

To be frank, it is entirely anecdotal that a JPEG image should be exported at a certain compression level all the time. The amount of JPEG compression should really depend on the usage purpose for the JPEG, and the contents of the JPEG. The quality level one should choose when exporting an image to JPEG is highly dependent upon the kind of detail contained ...


36

This is most likely caused by entropy coding, which is the final lossless stage of JPEG compression, after the image data has been quantized to reduce its size. When a JPEG image is losslessly rotated, this final lossless encoding layer must be undone, the unpacked DCT coefficients shuffled around, and then the shuffled coefficients need to be entropy coded ...


35

Although Philip's answer is the best way to go, it is possible to do what you want entirely within the sphere of JPEG. JPEG works by breaking your image up into blocks called Minimum Coding Units (MCUs), typically 16×16 each, and compressing them separately. You can see this in images when you crank the compression level up very high. At more ...


35

In my opinion, none of the other answers addresses the obvious misconception in the question: There is no use in converting a JPG (comparatively low quality) to a RAW file (high quality), because you do not gain anything. The reason why people shoot in RAW is that, as others have stated, RAW captures all the sensor data and saves it in a file. JPGs have ...


34

In short: there is no reason to care about this value and it its presence does not make your file larger. identify -verbose filename(s) only displays the quality if the image uses the standard quantization matrix. You can use nonstandard matrix (-define jpeg:q-table=...) to make this value disappear. The quality will be, however still displayed when the (...


32

Almost all image quality losses occur the first time an image is compressed as JPEG. Regardless of how many times a JPEG is recompressed with the same settings, generational losses are limited to rounding error. MCU boundaries remain are intact (8x8 blocks). Chroma subsampling is disabled. Constant DQT (same quality setting). However, rounding errors may ...


31

Beyond the very obvious memory card requirement differences between RAW and JPEG images as noted in the question: JPEGs are compressed and typically have much smaller file sizes. For example a RAW file from a Nikon D800 can be 50MB and the JPEG may be a fraction at 10MB. This benefits not only memory card capacity but also editing workflow speed, archival ...


31

In addition to the points Alex S made, you need to consider why they want RAW. There are several possible reasons: Bit depth as Alex S said. JPG suffers from compression artefacts which RAW doesn't. Blown up to exhibtion size these can jump out and ruin a print. Having the RAW file is often used as a proxy for having taken the photo, as RAWs aren't ...


30

The size of files compressed with JPEG vary depending on the complexity of the image. Trying the control the file sizes the way you describe will result in highly variable perceived image quality. Consider the following options instead: The good-enough approach. Use a quality setting that you find acceptable, like 75. Compare the size of the result with ...


26

RAW is not (or minimally) processed image data from camera sensor. JPEG is processed image data. Typically, raw-files from modern cameras have 12-14-bit per pixel which means up to 16384 values (for more details see Michael Clark's comment). JPEG can have only 256 luminance values per RGB channel. This means that jpeg contains much less data than a ...


24

On Windows, go to the folder, and run this in a command prompt: for /f "delims==" %r in ('dir /b *.nef') do del "%~dpr%~nr.jpg" 2> nul Basically, it goes through the current folder, runs through the NEF files, and deletes the JPG if present. It ignores any errors if the JPG is not there. If you want subfolders, include /s in the dir command.


24

I went ahead and repeated the experiment to see if I could figure out what's going on. Procedure I generated a random 256-by-256 pixel RGB image using the "Solid Noise" filter in GIMP (Filters > Render > Clouds > Solid Noise...) using the default settings (shown below): And the result: Then I saved the image as a JPEG using the default settings: Then I ...


23

Absolutely not. You need to edit the file and re-save it as a JPEG in order to compound the effects of image compression. Just viewing it has no effect at all — if it did, all of the JPEGs on the web would "wear out" completely in a day or two at most.


21

A JPEG from a camera is simply a RAW image that has had some additional processing applied. When viewing a RAW image in an image editing program, that program has to go through exactly the same steps as the camera did. If there is any difference in appearance, it is only due to differences in the following (in very rough order from most to least important)....


20

The point to remember here is that you lose quality when saving the photo into a lossy compression format. So long as you save the photo in a lossless format (PSD, TIFF, etc) after adding the border, you won't lose any more data than you've already lost by saving the photo as a JPEG in the first place.


20

EDIT: This answer was posted before I knew that the files had increased in size by around 9 KiB (9055 bytes for the 256×256 image, 9612 KiB for the 512×512 image). In all likelihood, when you first rotated the image, Windows Picture Viewer did one (or both) of the following things: Added an EXIF tag that was not in the original JPEG image (perhaps the ...


20

Recompression loss is real, especially when working with higher levels of JPEG compression. In theory, if you re-save a JPEG files with the exact same parameters and have aligned your crop to 8×8 blocks, the degradation should be minimal. However, if you're using a high level of compression, you will see further loss, because the artifacts introduced by the ...


19

An example Using the current photo of the week image. This is the high-quality JPEG: re-saved in Gimp with JPEG quality 80 (low); please note the general loss of sharpness, "dots" around high-contrast edges, loss of detail in low-contrast areas: and re-saved in GIMP with JPEG quality 30 (very low); please note evident 8x8 blocks and severe loss of ...


19

"To ensure that my photos display in the highest possible quality for display on Facebook, re-size your photo before you uploading" The supported sizes are: Regular photos 720 px, 960 px, 2048 px High Resolution Cover photos 851 px by 315 px (keep cover photos under 100K to avoid Facebook compression) (JPEG with an sRGB colour profile) Any other ...


19

In the absence of real raw files, the JPG is your "raw". Most image editors, including Lightroom, can open or import JPGs. You may choose to save in another format while editing, but do not lose or destroy the original JPGs. Also take care not to save over the original files. It is possible to convert JPGs to DNG. But it's usually used to test and develop ...


18

The reason you got confused is that it's not the file size that is displayed in Photoshop. Photoshop's status bar shows uncompressed size of image. With three 8-bit color channels, that's 3 bytes per pixel, resulting 34.9 MB for a 4288 x 2848 image from your camera. JPEG is a compressed format, so the actual file is smaller. Showing compressed size would ...


18

It sounds like what you're looking for is JPEG2000. It has a range of options including a 16-bit lossy compression and better compression ratios than JPEG. It hasn't been as widely adopted as hoped (for a host of reasons) and may have some patent issues that might make it difficult to use in certain situations but otherwise it fits your needs. Personally ...


18

No. This is a wrong approach. File size in pixels, yes, has something to do with the final weight, but it is not the only factor. Make a test. Take a completely white file of the same 2400x600px, and save it as JPG. Now take a photo of a forest (same 2400x600px) with lots of details and save it. This file will be larger using the same compression settings....


17

I default to the three-star setting (out of four), but I always use RAW + JPEG so I can revisit the choice, because there are situations where yes, it makes a difference. Particularly, when there is strong contrast across color channels, like a tree with red leaves or flowers against a blue sky, JPEG compression artifacts can be surprisingly visible with the ...


17

The image will be recompressed. The two scenarios you describe are actually effectively the same, because the lossy part of the JPEG compression discards information which stays gone when the image is decompressed. (Hence, lossy.) That means that reapplying with the exact same parameters shouldn't do much, either in terms of further space saves or in terms ...


17

Darktable handles JPEGs almost as RAWs. It just activates different processing modules by default, and e.g. the demosaicing module is of no effect for obvious reasons. See the Darktables module dependencies diagram. This diagramm is loosely processed from the bottom to the top by darktable. So, the arrows are followed in reverse direction. The user can ...


17

Short Answer No, decoding is not guaranteed to always be the same. However, the differences are guaranteed to be very, very small. ISO Specifications The International Organization for Standardization (ISO) specifications for JPEG has the following specifications for decoders (emphasis mine): A decoder shall a) with appropriate accuracy, convert ...


Only top voted, non community-wiki answers of a minimum length are eligible