Is this with PNG images? It can happen if you have a very optimised image and then regenerate it, since the PNG generation in System.Drawing in .NET doesn't optimize the newly created PNG very well. Unless you need transparency then your better off using JPEG (or converting to JPEG).
Note that Umbraco uses an (amazing) 3rd party library called ImagePrcocessor for all image cropping etc. I've raised this issue before with the author, and there's not much he can do. For context:
It's a hard call to make as to whether to avoid resizing PNGs at all - there are a lot of variables involved.
My general view is that if you have already optimised the PNGs with an optimisation service (like https://tinypng.com/) then resizing them will usually make them larger - though it will depend on the percentage you are resizing. If the original is large in dimension and you're just making a thumbnail, then it will be smaller, but if it's not that different it will end up larger.
If you are using mostly PNGs that are not optimised and you are resizing them downward by, say, 50% then it's probably worth it.
However, for most photographic images that don't require any transparency, if you can force the format to JPEG they will be smaller. You can do this in ImageProcessor using the ?format=jpeg query parameter:
No, the problems is only when you use low res PNGs. So it's a matter of recommendations you give to your content editors.
Do you have any optimisation services that you can recommend, for all images, not only PNGs? Preferably that can be integrated with the image cropper, and not having to optimise the images manually...
Image cropper is increasing the size of original image
A smaller image is cropped upwards, the size gets increased:
653x340 (547KB) gets cropped to 1440x525 (1.6MB)
Is this with PNG images? It can happen if you have a very optimised image and then regenerate it, since the PNG generation in System.Drawing in .NET doesn't optimize the newly created PNG very well. Unless you need transparency then your better off using JPEG (or converting to JPEG).
Note that Umbraco uses an (amazing) 3rd party library called ImagePrcocessor for all image cropping etc. I've raised this issue before with the author, and there's not much he can do. For context:
https://github.com/JimBobSquarePants/ImageProcessor/issues/98
It's a PNG, that's right. So there's nothing to do about it, except to avoid passing PNGs through the cropper?
Thank you Dan for your reply, very thorough and helpful!
It's a hard call to make as to whether to avoid resizing PNGs at all - there are a lot of variables involved.
My general view is that if you have already optimised the PNGs with an optimisation service (like https://tinypng.com/) then resizing them will usually make them larger - though it will depend on the percentage you are resizing. If the original is large in dimension and you're just making a thumbnail, then it will be smaller, but if it's not that different it will end up larger.
If you are using mostly PNGs that are not optimised and you are resizing them downward by, say, 50% then it's probably worth it.
However, for most photographic images that don't require any transparency, if you can force the format to JPEG they will be smaller. You can do this in ImageProcessor using the
?format=jpeg
query parameter:https://imageprocessor.org/imageprocessor-web/imageprocessingmodule/format/
No, the problems is only when you use low res PNGs. So it's a matter of recommendations you give to your content editors.
Do you have any optimisation services that you can recommend, for all images, not only PNGs? Preferably that can be integrated with the image cropper, and not having to optimise the images manually...
is working on a reply...