• Members 1085 posts
    April 9, 2023, 11:45 a.m.

    Hi all,

    I am new to post processing and have a question re resizing.
    I just want to reduce my image size to the 4MB upload limit that applies here.
    I shoot raw and jpeg 4000 x 3000 and most of my jpegs are about 6MB.
    I resized a pic by selecting applies to full image, Lanczos, scale 0.9, accepted the default jpeg quality and the result was only 1.5MB
    I want to maintain as much IQ as possible but am unsure whether to reduce my size or reduce jpeg quality. It all seems rather hit or miss.
    Is there a good balance or typical setting for jpeg quality?

  • Members 1085 posts
    April 9, 2023, 1:40 p.m.

    To answer in part my own question, I turned resize off and just played with jpg quality setting and 95% got me under 4MB but compared to the ooc jpg it is noticeably darker.

  • Members 5 posts
    April 9, 2023, 3:12 p.m.

    Every raw processor would by default output a different picture (sooc jpeg is technically a raw processor too, just built in camera), with different colors and brightness, and it is for you to adjust the settings to get desirable look.

    As for jpeg, no reason to go higher, 95% is almost indistinguishable from 100%, it's a norm for quality jpeg.

  • Removed user
    May 5, 2023, 3:33 p.m.

    I would decide a target medium size, for example 4K = 3840x2160px and crop to that rather than resize. No IQ lost with cropping!

    If I post JPEG, I use 100% quality but full chroma sub-sampling (4:2:0). See en.wikipedia.org/wiki/Chroma_subsampling

    As far as I know, there is no "typical" setting for JPEG.

  • Members 689 posts
    May 5, 2023, 4:16 p.m.

    By cropping you are throwing away parts of the image, while resizing you keep entire image. In your example 3840 x 2160 px image can be bigger than 4 MB or can be smaller.

  • Members 83 posts
    May 6, 2023, 6:32 p.m.

    To get an image below the 4mb threshold, I use graphicsmagick. I decrease JPEG quality gradually until I get the size that I want. An image with a gradient compresses smaller than an image with detail. Often a quality of 93 to 95 will be small enough. Since I am throwing away data anyway by reducing the quality, I use a JPEG created for display or print as a starting point instead of a 16 bit TIFF, but would use a 16 bit TIFF if I were planning to adjust colors instead of just making the file size smaller. I am willing to use the most compute intense color sampling and quantizing because computers are much faster now than when the JPEG standard was created in 1992. A lower JPEG quality setting does not look bad to me if there is a gradient in the colors.

    /opt/local/bin/gm convert -verbose IMG_3476c.JPG -define 'jpeg:dct-method=float,jpeg:optimize-coding=true' -interlace line -quality 90 IMG_3476cs2.JPG

    The above command line reduced the file size from 13374171 to 4161177 so it could be uploaded without too much loss of information.

    GraphicsMagick also uses good algorithms (default lanczos so far as I can remember) for resizing an image if decreasing the JPEG quality is insufficient.

    jpeg.org/jpeg/

  • Removed user
    May 6, 2023, 7:34 p.m.

    Obviously but "throwing away" adds a negative spin to the action.

    Resizing down removes detail and resizing up adds false detail. So what is "entire image"?

    Obviously. However I did mention JPEG quality and the OP shoots 4000x3000px ...

    So I cropped an image to 4K - 3840 x 2160 px, selected 4:2:0 JPEG sub-sampling and 100% quality.

    Per you dire observation, it came to over 4MP. Reducing quality to 97% brought it down to 3.445MP
    [/quote]

  • Removed user
    May 12, 2023, 4:20 p.m.

    LOL ... Threadstopper Ted strikes again ...

  • Foundation 1502 posts
    May 12, 2023, 5:08 p.m.

    Bryan,

    The 4MB limit no longer applies; but in my opinion there is generally no advantage in going above 6MB or so. Having done my processing from raw file to tiff in PhotoLab, and sometimes AI Sharpen also, I resize it in Photoshop, saving as jpg. I reduce the size to what I think looks good at 1:1, and then do unsharp masking. If I then save and the file size is larger or smaller than I want, I backtrack in Photoshop (easy to do) and adjust the size, repeating the other steps. For this site, I always save jpgs at nearly maximum quality ("11" in Photoshop), as I assume users are interested in quality. I can never quite predict the size of a jpg: it depends on the photo. More detail means a larger file, and less (like lots of blue sky) means a smaller one.

    In other words, I prefer to reduce the size, rather than jpg quality. I hope this helps.

    David

  • Members 83 posts
    May 13, 2023, 1:50 p.m.

    The 1992 JPEG standard specified quality levels from 1 to 100. I am mildly irritated by software that offers a different range. en.wikipedia.org/wiki/JPEG

    I agree with most of what you wrote, my preference is different than yours and I do not criticize yours. I prefer to use the quality parameter to reduce the file size of a JPEG for upload to a site that permits viewing at the original resolution, but I scale the image smaller if I am putting it on my web server for display on mostly small limited resolution screens. When scaling the image smaller, then I will use a JPEG quality of 97 which provides some compression. I do not know what might be the equivalent of a JPEG 97 quality in photoshop. I also prefer floating point to integer for the discrete cosine transform step in creating a JPEG. I do not specify "-sampling-factor" and the default seems to be "Y Cb Cr Sub Sampling : YCbCr4:4:4 (1 1)". (Since it was thirty years ago that I chose my JPEG preferences, it might be time to reconsider). "Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1)" produces a smaller file, in the example below 1121990 bytes vs. 1425631 bytes for "4:4:4". For even smaller file size, use "Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)". The decrease in quality is not obvious to me when I view in a web browser, so I might be wasting bandwidth. You can see what was done by using exiftool: "exiftool -YCbCrSubSampling *.JPG"

    I cannot guess what photoshop might be doing.

    A higher JPEG quality number will preserve more detail and an image with more pixels will contain more detail. Some of that detail might not be noticeable when viewed on a screen. Whether the number of pixels matters depends upon the viewing surface and viewing distance.

    This graphicsmagick command line produces a JPEG for display on my web server:
    gm convert -verbose IMG_3804c.JPG -resize "37.5%" -unsharp 0x1 -mattecolor black -frame 16x16 -font helvetica -fill white -draw "text 4,1228 'Cedar Waxwing (Bombycilla cedrorum) in Norman, Oklahoma, United States on April 21, 2023, Copyright www.rsok.com/~jrm/ All rights reserved.'" -define 'jpeg:dct-method=float,jpeg:optimize-coding=true' -interlace line -quality 97 2023apr21_waxwing_IMG_3804c.jpg

    www.rsok.com/~jrm/2023Apr22_birds_and_cats/2023apr21_waxwing_IMG_3804c.html

    The JPEG standard includes lossless compression, but I guess that most software does not offer that as an option.

    Cedar Waxwing (Bombycilla cedrorum) in Norman, Oklahoma, United States on April 21, 2023

  • Removed user
    May 13, 2023, 4:38 p.m.

    Me too ... my Sigma raw converter goes from 1 to 12 most non-intuitive, grump.

    Agreed. FYI, FastStone Viewer offers that as one of their photometric options ... also grayscale.

    I usually post at 100% quality and 4:2:0 mainly to have less obvious JPEG artifacts than with 4:4:4 and some lower quality. I don't use "medium" 4:2:2 because I don't like the idea of sub-sampling chroma in one direction only

  • Foundation 1502 posts
    May 13, 2023, 6:05 p.m.

    John and xpatUSA,

    I bow to your superior knowledge regarding the JPEG specification and what you have written. I also know that if I were to follow this up it would be to go down a deep rabbit hole.

    I shoot raw on my Canon R6, and Sony RX-100, and for most of the processing of images I use 16-bit tiff. Jpeg conversion is not something I do as a matter of course, but only for web display, as I hate the nasty compression artifacts that it can produce. So other than for web use, I save jpegs as 100%, with no compression. When this site limited us to files of 4MB, I wanted to optimize the size of my photos, in case others wanted to see them large, and in that event it seemed to me that reducing the filesize by means of jpeg compression would be less satisfactory than reducing the number of pixels. John's bird picture above is very clean and manages to avoid these artifacts, although it is small. (The only thing I see in it that I try to avoid is the white halos that I see around the birds' heads and bodies!) Now that the 4MB limit has been lifted, I find that somewhere around 6MB is satisfactory for me.

    So I shall continue to experiment in my empirical manner!

    I dont know if that makes any sense to you, but I thank you both for your responses.

    David

  • Members 83 posts
    May 13, 2023, 9:26 p.m.

    I could have avoided the halos by using less unsharp mask, but since they are as single pixel overshoot in the unsharp mask I think they make the image look better at a greater viewing distance. Birds in dark shade with bright sky in the background are difficult. Unsharp mask at a high contrast edge has more overshoot.

    IMG_3804c.JPG A higher resolution larger file size version.

    IMG_3804c.JPG

    JPG, 13.3 MB, uploaded by JohnMoyer on May 13, 2023.