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

Commented Issue: Percentage Resize doesn't resize [1389]

$
0
0
While trying to improve PerceptualHash performance, I came across a couple errors. With very large images, PerceptualHash takes forever to compute. I'm submitting the errors as separate issues with the same code sample.

Resize(Percent), as seen below, doesn't change the size of the image.

Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg

```
public static ImageMagick.PerceptualHash PHash(this FileInfo file, int imageSizeConstraint = 5000)
{
if (imageSizeConstraint < 1000)
imageSizeConstraint = 1000;
using (MagickImage image = new MagickImage(file.FullName))
{
if (image.Width > imageSizeConstraint || image.Height > imageSizeConstraint)
{
double percent = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}

```

I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.
Comments: You will need to multiply your `percent` value. 50% is 50 and not 0.5.

Closed Issue: Percentage Resize doesn't resize [1389]

$
0
0
While trying to improve PerceptualHash performance, I came across a couple errors. With very large images, PerceptualHash takes forever to compute. I'm submitting the errors as separate issues with the same code sample.

Resize(Percent), as seen below, doesn't change the size of the image.

Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg

```
public static ImageMagick.PerceptualHash PHash(this FileInfo file, int imageSizeConstraint = 5000)
{
if (imageSizeConstraint < 1000)
imageSizeConstraint = 1000;
using (MagickImage image = new MagickImage(file.FullName))
{
if (image.Width > imageSizeConstraint || image.Height > imageSizeConstraint)
{
double percent = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}

```

I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.

Edited Issue: Percentage Resize doesn't resize [1389]

$
0
0
While trying to improve PerceptualHash performance, I came across a couple errors. With very large images, PerceptualHash takes forever to compute. I'm submitting the errors as separate issues with the same code sample.

Resize(Percent), as seen below, doesn't change the size of the image.

Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg

```
public static ImageMagick.PerceptualHash PHash(this FileInfo file, int imageSizeConstraint = 5000)
{
if (imageSizeConstraint < 1000)
imageSizeConstraint = 1000;
using (MagickImage image = new MagickImage(file.FullName))
{
if (image.Width > imageSizeConstraint || image.Height > imageSizeConstraint)
{
double percent = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}

```

I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.

Commented Issue: 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: We continued the conversation by e-mail and found a bug in the OpenCL code. This is now fixed in the current development version.

Closed Issue: 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.

Commented Unassigned: Animated gif generating [1378]

$
0
0
I can't really understand, why gif animation isn't working without this?
```
//Optionally reduce colors
QuantizeSettings settings = new QuantizeSettings { Colors = 256 };
collection.Quantize(settings);

// Optionally optimize the images (images should have the same size).
collection.Optimize();
```
2 png frames, same size. Without code above it creates gif with only 1 frame. With code above, everything is fine. Is it a bug of reature?
Comments: Can you get back to me on this issue? Otherwise I will have to close this issue.

Closed Unassigned: Make DrawablePath chainable [1384]

$
0
0
Make it possible to change:

```C#
image.Draw(new DrawablePath(
new PathMoveToAbs(75, 70),
new PathLineToAbs(90, 20),
new PathLineToAbs(105, 70)));
```
into:
```C#
image.Draw(new DrawablePath()
.MoveToAbs(75, 70)
.LineToAbs(90, 20)
.LineToAbs(105, 70)));
```


Created Unassigned: Rebuild for Q16-HDRI-AnyCPU Errors [1390]

$
0
0
Dear Dlemstra,
I've download Magick.net source code from https://magick.codeplex.com/SourceControl/latest.
I want to modified files Magick.NET/Core/MagickImageCollection.cs, Magick.NET/Core/MagickImage.cs, Magick.NET/Core/MagickImageInfo.cs with add attribute Serializable() to make classs serializable, when i rebuild solution it raise many error that I don't understand (Also I've refer at https://magick.codeplex.com/SourceControl/latest#Building.md).

Someone please help me.

Edited Unassigned: Rebuild for Q16-HDRI-AnyCPU Errors [1390]

$
0
0
Dear experts,
I've download Magick.net source code from https://magick.codeplex.com/SourceControl/latest.
I want to modified files Magick.NET/Core/MagickImageCollection.cs, Magick.NET/Core/MagickImage.cs, Magick.NET/Core/MagickImageInfo.cs with add attribute Serializable() to make classs serializable, when i rebuild solution it raise many error that I don't understand (Also I've refer at https://magick.codeplex.com/SourceControl/latest#Building.md).

Someone please help me.

Closed Unassigned: Rebuild for Q16-HDRI-AnyCPU Errors [1390]

$
0
0
Dear experts,
I've download Magick.net source code from https://magick.codeplex.com/SourceControl/latest.
I want to modified files Magick.NET/Core/MagickImageCollection.cs, Magick.NET/Core/MagickImage.cs, Magick.NET/Core/MagickImageInfo.cs with add attribute Serializable() to make classs serializable, when i rebuild solution it raise many error that I don't understand (Also I've refer at https://magick.codeplex.com/SourceControl/latest#Building.md).

Someone please help me.

Created Unassigned: Trying to convert svg content into pdf [1391]

$
0
0
I am trying to convert SVG content into pdf, svg content has one png base 64 content which is not being visible after converting to pdf.

Please help me sort it out this issue. The svg content is attached. I am using Magick.NET-x64 7.0.0.0.

Created Unassigned: Issues converting image [1392]

$
0
0
Hi,

I was using ImageMagick for quite a long time. I thought of using Magic.Net latest version for my .net project. However, the image conversion is not so good. I am trying to convert the EMF format file to JPG format.

[Source image in emf format](https://onedrive.live.com/redir?resid=B10A379CA3C7C4BA!2235&authkey=!AB5LUZzqZefFSSY&ithint=file%2cemf)

[Converted using V7.0.1](http://postimg.org/image/u6dj8f5up/)

Please fix.

Thanks

Created Unassigned: Crashes my disply driver [1393]

$
0
0
Hi,

I am trying to resize an image. Below is my code. It takes huge time and crashes my display driver.

Let me know how to fix the problem.

Thanks

```
private static void ConvertImgUsingMagickDotnet(string sourceImg, string targetImg)
{
MagickReadSettings settings = new MagickReadSettings();
// Settings the density to 600 dpi will create an image with a better quality
settings.Density = new Density(600);

// Read first frame of gif image
using (MagickImage image = new MagickImage(sourceImg, settings))
{
//When zero is specified for the height, the height will be calculated with the aspect ratio.
image.Resize(479, 0);
// Save frame as jpg
image.Write(targetImg);
}
}
```

Created Unassigned: Issue when converting a PDF to PNG [1394]

$
0
0
I have noticed issues when converting large PDF (3.5MB and higher) that it freezes the system, and in the course of 5 minutes will create temp files over 10GB in size.

Let me know if you need any info

Commented Unassigned: Trying to convert svg content into pdf [1391]

$
0
0
I am trying to convert SVG content into pdf, svg content has one png base 64 content which is not being visible after converting to pdf.

Please help me sort it out this issue. The svg content is attached. I am using Magick.NET-x64 7.0.0.0.

Comments: What is the exact version that you are using? You can use `MagickNET.Version` to determine that.

Commented Unassigned: Issues converting image [1392]

$
0
0
Hi,

I was using ImageMagick for quite a long time. I thought of using Magic.Net latest version for my .net project. However, the image conversion is not so good. I am trying to convert the EMF format file to JPG format.

[Source image in emf format](https://onedrive.live.com/redir?resid=B10A379CA3C7C4BA!2235&authkey=!AB5LUZzqZefFSSY&ithint=file%2cemf)

[Converted using V7.0.1](http://postimg.org/image/u6dj8f5up/)

Please fix.

Thanks
Comments: The problem with EMF images is the quality of the drawn text I assume. You can 'fix' this by reading the image at a larger size and then resize it to the size you want it to be: ```C# using (MagickImage image = new MagickImage()) { image.Read(@"c:\source.emf", new MagickReadSettings() { Density = new Density(300) }); image.Resize(480, 0); image.Write(@"c:\test.jpg"); } ```

Commented Unassigned: Crashes my disply driver [1393]

$
0
0
Hi,

I am trying to resize an image. Below is my code. It takes huge time and crashes my display driver.

Let me know how to fix the problem.

Thanks

```
private static void ConvertImgUsingMagickDotnet(string sourceImg, string targetImg)
{
MagickReadSettings settings = new MagickReadSettings();
// Settings the density to 600 dpi will create an image with a better quality
settings.Density = new Density(600);

// Read first frame of gif image
using (MagickImage image = new MagickImage(sourceImg, settings))
{
//When zero is specified for the height, the height will be calculated with the aspect ratio.
image.Resize(479, 0);
// Save frame as jpg
image.Write(targetImg);
}
}
```
Comments: The problem is most likely an OpenCL issue. I cannot reproduce it on my machine so this might be a driver issue. Setting OpenCL.IsEnabled to false should solve your issue.

Closed Unassigned: Crashes my disply driver [1393]

$
0
0
Hi,

I am trying to resize an image. Below is my code. It takes huge time and crashes my display driver.

Let me know how to fix the problem.

Thanks

```
private static void ConvertImgUsingMagickDotnet(string sourceImg, string targetImg)
{
MagickReadSettings settings = new MagickReadSettings();
// Settings the density to 600 dpi will create an image with a better quality
settings.Density = new Density(600);

// Read first frame of gif image
using (MagickImage image = new MagickImage(sourceImg, settings))
{
//When zero is specified for the height, the height will be calculated with the aspect ratio.
image.Resize(479, 0);
// Save frame as jpg
image.Write(targetImg);
}
}
```

Closed Unassigned: Issues converting image [1392]

$
0
0
Hi,

I was using ImageMagick for quite a long time. I thought of using Magic.Net latest version for my .net project. However, the image conversion is not so good. I am trying to convert the EMF format file to JPG format.

[Source image in emf format](https://onedrive.live.com/redir?resid=B10A379CA3C7C4BA!2235&authkey=!AB5LUZzqZefFSSY&ithint=file%2cemf)

[Converted using V7.0.1](http://postimg.org/image/u6dj8f5up/)

Please fix.

Thanks

Commented Unassigned: Issue when converting a PDF to PNG [1394]

$
0
0
I have noticed issues when converting large PDF (3.5MB and higher) that it freezes the system, and in the course of 5 minutes will create temp files over 10GB in size.

Let me know if you need any info
Comments: Do you have a small code sample and input image that I can use to reproduce the issue? Feel free to contract me through CodePlex if you don't want to share it publicly. And are you using the latest version of Magick.NET?
Viewing all 1011 articles
Browse latest View live