Quantcast
Channel: magick Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1011

Commented Unassigned: image.Thumbnail not taking color adjustments properly [1385]

$
0
0
I have this code:

```
public MagickImage NewThumbImageTCBordered()
{
var image = ImageTC.Clone();
image.Resize(ThumbSize);
//image.Thumbnail(ThumbSize);
AdjustColor(image);
image.Write(ThumbFile().FullName);
return image;
}

public void AdjustColor(MagickImage image)
{
var color = View.Color;
if (color.Brightness != ColorAdjustments.BrightnessDefault
|| color.Contrast != ColorAdjustments.ContrastDefault)
image.BrightnessContrast(new Percentage(color.Brightness), new Percentage(color.Contrast));

if (color.Gamma != ColorAdjustments.GammaDefault)
image.GammaCorrect(color.Gamma);

if (color.Red != ColorAdjustments.RedDefault)
image.Evaluate(Channels.Red, EvaluateOperator.Add, color.Red);

if (color.Green != ColorAdjustments.GreenDefault)
image.Evaluate(Channels.Green, EvaluateOperator.Add, color.Green);

if (color.Blue != ColorAdjustments.BlueDefault)
image.Evaluate(Channels.Blue, EvaluateOperator.Add, color.Blue);
}

public static MagickGeometry ThumbSize
{
get
{
return _ThumbSize ?? (_ThumbSize = new MagickGeometry(ThumbSizeDTO.Size.Height));
}
}
static MagickGeometry _ThumbSize;

```

I've had to exchange image.Thumbnail(...) for image.Resize(...) because image.Thumbnail now makes negative (or blank) images based on the color modifiers .

Example:

Original Image
![Image](http://i.imgur.com/dOtiV6f.jpg)

Adjust the image by adding 5 contrast. Image has also been flipped horizontally.

Thumbnail created with Resize
![Image](http://i.imgur.com/pu9Gi6N.png)

Thumbnail created with Thumbnail
![Image](http://i.imgur.com/JSe1mq3.png)

I have this same problem appearing in multiple images, but not all images by adjusting any one or more of the colors or contrast. Haven't tested gamma, but it may also be affected. Contrast changes seems to break the thumbnail image sooner than color changes.

I have the most recent ImageMagick NuGet package as of today.
Comments: The thumbnail method removes color profiles besides resizing the image. This could cause color issues. It is also possible that your source image is a CMYK jpeg file. I am not sure if imgur converts the images after you upload them. Can you contact me through CodePlex so you can e-mail me the original or put it on DropBox and add a link here?

Viewing all articles
Browse latest Browse all 1011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>