minimagick/minimagick — pull request #114 by kaspergrubbe (2013-01-16 21:49:37+00:00)
Title: Made the test-suite green by fixing the colorspace

Hi,

I just made the testsuite green. The issue is that ImageMagick apparently assumes that all images is of the colorspace of sRGB. I found this in the documentation:

> The first major change was to swap -colorspace RGB and -colorspace sRGB. In earlier versions, RGB really meant non-linear sRGB. With the completion of the changes, RGB now means linear color and sRGB means non-linear color in terms of their respective colorspaces.

> ImageMagick supports color profiles, however, for images without a profile or a declaration of colorspace, ImageMagick assumes non-linear sRGB. Most image processing algorithms assume a linear colorspace, therefore it might be prudent to convert to linear color or remove the gamma function before certain image processing algorithms are applied. For example,

> Afterwards, the verbose information for the output file lists the colorspace as RGB. **This only works on image types containing meta data that distinguishes between linear RGB and non-linear sRGB, such as PNG and GIF. Therefore, if the above command is run with a JPG or TIF output format, the verbose information for the colorspace still shows sRGB.** In order to properly have the JPG output know that it is linear RGB, include an appropriate color profile.

http://www.imagemagick.org/script/color-management.php

Afterwards I saw an error where

```ruby
image[:colorspace] # would return 'PseudoClass sRGB ' (space in the end)
```

So I stripped the output from the command-calling.