caesium-image-compressor icon indicating copy to clipboard operation
caesium-image-compressor copied to clipboard

Resize does not upscale images

Open BigBoyBarney opened this issue 2 years ago • 4 comments

Hi! First of all, thanks for this amazing program. As you'll see in the log file, I just finished quite a large compression, which would've been pretty much impossible without it.

Describe the bug The resize option doesn't actually scale the images up (even if the "Do not enlarge" option is not enabled). The image size stays the same. If I enter a size lower than the original image size, it scales down correctly

Software version v.2.1.0

Operating System information Windows 10

To Reproduce Steps to reproduce the behavior:

  1. Input an image smaller than 2160px short side
  2. Enable resize to "short edge" and 2160px
  3. "Do not enlarge" is NOT selected
  4. Press "compress"
  5. Image size stays the same (regardless of lossless / lossy compression)

Expected behavior Image size is increased to 2160px short side

Screenshots Settings: image Operation "successful" (warning triangle) image Image was not resized, new size is the same as the old one. image

Application Log caesium-2022-08-04.log (Log file shows no errors, even though a warning triangle appears in screenshot 1)

Additional context I noticed something interesting. If I input a larger target size than the original, the operation takes roughly 1300ms and the file does not compress at all and size stays the same. If I input the same values again, but enable "do not enlarge" the operation take 50ms and the image is compressed (and not resized, of course)

BigBoyBarney avatar Aug 04 '22 17:08 BigBoyBarney

Hi!

In the first screenshot I see the warning icon, but I can't see the warning message. I reproduced your steps and probably the image did not compress at all because the output image was bigger than the original (in bytes, not pixels of resolution). Caesium automatically discards compressed images which size is bigger than the original, but this may be a problem in your scenario. Thus this is not a "bug" but probably something I might address with an option to still output the compressed image even if it's bigger.

PS: about the additional context you provided, it's a correct behaviour: Caesium first tries to compress, sees that the size is bigger, then discards the compressed file. If you enable "Do not enlarge" (which refers to resolution, not size) Caesium just skips the entire process because you told him to upscale the image.

Lymphatus avatar Aug 05 '22 07:08 Lymphatus

Ahh, that makes so much sense, actually. In that case, it's completely intended and works as it's supposed to. Now that I think about it, it would be super counter-productive to output images larger than the original in a dedicated image compressor 🤣

My use case was probably quite niche, as with this operation, I didn't care about compression at all and just wanted to resize a batch of images.

If you could add an option to force the image output even if it's larger than the original, or a dedicated "resize only" option where Caesium doesn't care about compression and just resizes, I would be very glad.

Regardless, thanks for your response! Have a nice day! Barney

BigBoyBarney avatar Aug 05 '22 08:08 BigBoyBarney

If you could add an option to force the image output even if it's larger than the original

This is a pretty easy option to add, probably in the "Output" tab. Caesium 1.7 actually had something similar. Converting this issue in a Feature Request.

Lymphatus avatar Aug 05 '22 09:08 Lymphatus

That'd be fantastic, thank you!<3

BigBoyBarney avatar Aug 06 '22 17:08 BigBoyBarney