janko / image_processing

High-level image processing wrapper for libvips and ImageMagick/GraphicsMagick
MIT License
873 stars 77 forks source link

Please disable default image sharpening in the VIPS backend #113

Open pyridine opened 1 year ago

pyridine commented 1 year ago

Hi, this is related to https://github.com/carrierwaveuploader/carrierwave/issues/2481 and https://github.com/janko/image_processing/pull/67 Default image sharpening was disabled a while back in the ImageMagick backend, but not in the VIPS backend. I think it should be disabled by default in both. The default sharpening behavior is not expected and can degrade/change the image quality.

Here are the results of resizing an image in VIPS vs ImageMagick:

Base image base image Converted with ImageMagick backend converted with imagemagic backend, it appears the same Converted with VIPS backend converted with vips backend, it looks worse

As with the original issue, the ImageMagick-processed image has not changed (much?), while VIPS-processed image appears lower quality, or at least different, which is not expected.

I used this code:

processed = ImageProcessing::Vips # or MiniMagick
  .source(base_image)
  .resize_to_fit(1280,720) # the image is already this size, so this shouldn't change anything
  .convert("png")
  .call
midnight-wonderer commented 4 months ago

Your eyes are really good; I couldn't tell the difference. For those who are like me, here is where to look: diff Created with: _ttps://www.diffchecker.com/image-compare/

P.S. I could see it in the original post once pointed out.

janko commented 4 months ago

I plan to disable automatic sharpening in libvips for the upcoming major release. I agree it's unexpected, and it would be consistent with disabling it for the MiniMagick backend. I will still keep a default sharpen mask that can be turned on.

formigarafa commented 2 months ago

I'm impressed with what you guys can see. Thank you for that, but I didn't. ❤️