How to Reduce the Quality of an Uploading Image Using Paperclip

How can I reduce the quality of an uploading image using Paperclip?

Try using convert_options.

has_attached_file :avatar, 
:styles => { :thumb => '50x50#' },
:convert_options => { :thumb => '-quality 80' }

Paperclip: why, despite the reduction of quality, the size of an image does not change much?

The options should work fine, maybe your image just doesn't compress that well. Try to playing around with the convert tool on the command tool (see docs) to see what helps. Also, it appears that paperclip can now take a :quality option directly.

Rails reduce image size on some %

You can use the convert_options

has_attached_file :image, 
:convert_options => { :thumb => '-quality 50' }

or you can try this one

has_attached_file :image => { :quality => :better } 

Refer: Paperclip doc

How to reduce dpi to 72 for thumbs in paperclip, originals are 300 - rails 3.2

has_attached_file :uploadedPhoto, 
:styles => {:portrait => "400x", :icon => "32x32#"},
:convert_options => {:portrait => '-strip -quality 60', :icon => '-strip -quality 60' }

upload image without losing quality in rails

Choosing between CarrierWave, Paperclip and Refile can be difficult at
times, but I would always recommend CarrierWave. It is the most
powerful and customizable of the three. It keeps your code organized
and clean, and is easy to test.

Refile isn't ready for prime time yet as it is still experiencing
growth pains and has DoS issues, and Paperclip is fairly simplistic.

Sample Image

For more information please see this acrticle: Best Rails image uploader - Paperclip vs. Carrierwave vs. Refile



Related Topics



Leave a reply



Submit