carrierwave-vips
carrierwave-vips copied to clipboard
How to specify resizing kernel options
Hi there, first of all thank you for all the hard work in this gem. After replacing the standard minimagick resize I'm getting different (By a small but noticeable margin) quality results in jpg resizing, even after removing the sharpening mask. Looking at https://github.com/eltiare/carrierwave-vips/blob/master/lib/carrierwave/vips.rb#L255 it seems resizing images uses either nearest or cubic filter, but ruby vips has more kernel options, with some more coming down the line (See https://github.com/jcupitt/libvips/commit/3b1e3e1841dab816dcf9550bde857423fb57b77f). Is there already a way to pass image resize kernel option and it just needs documenting? Or maybe I should tweak different options to get the quality I used to have with image magick?
Here is the image processed by imagemagick(check the ceiling):
Here is the image processed by vips, no sharpening mask:
There are currently no options outside of sharpening for this gem (to my memory). I'm open to either a PR or suggestions. If you're going to do a PR, it's probably best to set it via the configure block.
Thanks for the quick reply. That sounds good. Would it make sense to be able to pass on that config block both an 'enlarging' kernel (defaulting in :nearest) and a 'shrinking' kernel (defaulting to :cubic) ?
Yeah. Try to make it obvious in the name that it's for resizing.
@eltiare Here's a pr to add those config options! https://github.com/eltiare/carrierwave-vips/pull/31