Paperclip (imagemagick) generates dark images

pierallard

I'm using paperclip gem to resize images. The issue is that resized images are "dark". I attached two examples of the original image and the resized one.

Here is the code generating images :

has_attached_file :result,
  :styles => {
    :medium => { :geometry => '262' },
  },
  :hash_secret => "xxx",
  :url => "/system/:class/:attachment/:id_partition/:style/:hash.:extension",
  :hash_data => ":class/:attachment/:style/:id"
validates_attachment :result, :content_type => { :content_type => /\Aimage\/.*\Z/ }

I can see this line in the log :

Command :: convert '/tmp/xxx.png[0]' -auto-orient -resize "262" '/tmp/xxx20150110-9669-z4rtiy'

Original image

Resized image

Mark Setchell

Trying adding -colorspace sRGB into your convert command like this to force the colorspace:

convert input.png -resize 262 -colorspace sRGB output.png

Your command works fine on my (very current) version of ImageMagick as is, but if I put -colorspace RGB it comes out dark here too. I believe the default colorspace changed in recent versions of IM.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Paperclip (imagemagick) generates dark images

From Dev

Rails 4 , ImageMagick and PaperClip

From Dev

Paperclip, ImageMagick "UnrecognizedAlphaChannelType `remove'"

From Dev

ImageMagick/Paperclip - Paperclip fails during large job

From Dev

Paperclip for both images and Videos

From Dev

Is Rails Paperclip only for Images?

From Dev

Uploading multiple images with paperclip?

From Dev

Adding multiple images with paperclip

From Dev

Unknown error with Paperclip and ImageMagick - Rails 2

From Dev

Paperclip cannot find ImageMagick on AWS Elastic Beanstalk

From Dev

Unknown error with Paperclip and ImageMagick - Rails 2

From Dev

Watermark images with paperclip, rails 4

From Dev

Remove paperclip images Active Admin

From Dev

Export paperclip images in a clean hierarchy

From Dev

Rails - paperclip not uploading any images

From Dev

Export paperclip images in a clean hierarchy

From Dev

ImageMagick convert generates an extra copy

From Dev

ImageMagick convert generates an extra copy

From Dev

ImageMagick / Colorspace 'safe' images

From Dev

TCropping images with loop in imagemagick

From Dev

Cropping images with loop in Imagemagick

From Dev

Appending images vertically in ImageMagick

From Dev

Use ImageMagick to compare Images

From Dev

Resize images with imagemagick

From Dev

TCropping images with loop in imagemagick

From Dev

Convert multiple images with ImageMagick

From Dev

How to rewrite images imagemagick?

From Dev

Imagemagick to merge and mask images

From Dev

Dark Thumbnails on EC2 with ImageMagick / RMagick