Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is sharpening enabled or not? #78

Open
collimarco opened this issue Jan 6, 2021 · 2 comments
Open

Is sharpening enabled or not? #78

collimarco opened this issue Jan 6, 2021 · 2 comments

Comments

@collimarco
Copy link

After upgrading to Rails 6.1 I noticed a change in the thumbnail image quality... they seem a little bit blurred. I don't know if this happened some months ago or after the upgrade, however I think that the quality of images was better 1 year ago when we decided the compression options.

Then I have also found this:
https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#active-storage-now-requires-image-processing

Now I am really confused and I cannot find a clear documentation about sharpening and other options enabled by default by this gem.

  1. Does resize apply sharpening automatically?
  2. Does resize_to_fit/limit/fill apply sharpening automatically?
  3. Is sharpening applied automatically by this gem in the following case (that doesn't use resize and doesn't use resize_to_*)?
  image.variant({
      geometry: '600x300^',
      gravity: 'center',
      crop: '600x300+0+0',
      'sampling-factor': '4:2:0',
      strip: true,
      quality: 85,
      interlace: 'JPEG',
      colorspace: 'sRGB'
  })

Thanks in advance for the clarification

Version: image_processing 1.12.1 (latest)

@janko
Copy link
Owner

janko commented Jan 6, 2021

Default sharpening was recently removed from the MiniMagick backend, see #67 and carrierwaveuploader/carrierwave#2481 for more details. TL;DR: The sharpening parameters were making some thumbnails worse than the default version. I didn't manage to acquire enough knowledge to choose safer sharpening parameters, so I've decided to disable it.

To answer your questions:

  1. resize doesn't apply sharpening
  2. resize_* macros did apply sharpening, but not anymore
  3. sharpening is not applied by deafult

You can enable sharpening with resize_* macro by passing as the last argument sharpen: {}, or just adding sharpen: "0x1" or whatever sharpening parameters you prefer (0x1 was the default).

@feliperaul
Copy link

@janko Janko, would you know how I could sharpening when using a process resize_to_* macro with Carrierwave?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants