Paperclip: why, despite the decline in quality, the image size does not change much?

I am running Ruby on Rails 3 and I would like to reduce the size (in bytes) of the loaded image using the Paperclip plugin / gem. I need this because I would like to improve the performance related to the load time of web pages in my application.

At this time, in my model file, I:

  has_attached_file :avatar, 
    :styles      => {
      :small    => ["250x250#", :jpg] 
  }
  :convert_options => { :small => '-quality 40' }

This converts the image to a format .jpg, sets the size and reduces the quality to 40 (this value is for testing only).

However, I noticed that, despite the decline in quality, the file size does not change much. For example, I report the size of the image with and without using the option :convert_options => { :small => '-quality 40' }:

# Without using the 'convert_options'
Image size: 57.35 kB (58730 bytes)

# Using the 'convert_options'
Image size: 55.25 kB (56576 bytes)

Why is the difference so small? What is the best practice of downsizing without quality loss?


. , @Matt , , " " (, ). , , ,... .

+3
3

, , . convert (. Docs), , . , , :quality.

+1

, , . , amazon s3 ( ), ? , , . , , , . , ( , ) , , .

+3

convert_options (ae: small), issue

+1

Source: https://habr.com/ru/post/1792007/


All Articles