Quantcast
Channel: magick Discussions Rss Feed
Viewing all 3693 articles
Browse latest View live

New Post: Composite Image

$
0
0
Thanks for getting the library fixed.
The sample code was just a test of concept before it was implemented.

New Post: Embedded ICC profile issue

$
0
0
I don't have or use Photoshop so I cannot run some tests myself. Is it possible that Photoshop is complaining about an Adobe RGB color profile in a GrayScale image?

New Post: Embedded ICC profile issue

$
0
0
I suppose it's possible. But Photoshop is able to open up the original just fine. And within Photoshop, if I save that as a jpg, that's fine as well. I'm not sure where to look next.

New Post: Embedded ICC profile issue

$
0
0
Can you e-mail me the jpeg you saved from Photoshop so I can compare it with the image created by Magick.NET?

New Post: Embedded ICC profile issue

$
0
0
Jumping in here. With Adobe Photoshop CS4 Extended I get an error with the image.

"The embedded ICC profile cannot be used because the ICC profile is invalid. Ignoring the profile."
[Continue] [Cancel]

Darren

New Post: Embedded ICC profile issue

$
0
0
Are you talking about the original image or the image created with the code in this post?

New Post: Block Processing For Large Images

$
0
0
Is there some type of block processing in IM so I can handle very large images? See link for details http://www.mathworks.com/help/images/examples/block-processing-large-images.html

I'm trying to Canny process a 400 DPI image 16800 x 12000 pixel, 1bpp, Group IV compressed image and it takes a long time. Actually I'm not sure it will complete because I'm too impatient. I've waited 5 minutes and killed it because it just was taking too long. So I was wondering if there was a way I could process a block at a time, show the results, then move to the next block.

Here's link to the file http://1drv.ms/1gDBrPs

Thanks,
Darren

New Post: Embedded ICC profile issue

$
0
0
dlemstra wrote:
Are you talking about the original image or the image created with the code in this post?
Sorry. I was talking about the original TIFF linked in the first thread of this discussion.

New Post: Embedded ICC profile issue

$
0
0
Hmmm. I guess I used a different version when I ran my test. Sorry about that guys. And thanks

New Post: Converting a PDF to JPG and then scaling turns the image black

$
0
0
My code to convert a PDF file to JPG works great, but if I try to use images[0].Scale(50.0,50.0); where images is an ImageCollection and images[0] is an Image that appears fine when written; it will scale my image down, but it turns the majority of the image solid black. Is there a setting I can set or better way for resizing images based on percentage that are in an ImageCollection?

New Post: Converting a PDF to JPG and then scaling turns the image black

$
0
0
Can you post a link to your pdf file so I can reproduce your issue?

New Post: Merging Images Together

$
0
0
I've asked this question once before, but the original solution no longer works after I recently upgraded to the newer Magick.NET.

I am trying to put an image on a white background. My 'output' must be a specific size, so I am putting a white background behind any image uploaded so that it always ends up the correct size. The code below works, except that the 'from' image needs to be centered. I used to be able to center it, but that option gives a compile error now.

I just need to know how to do the 'merge' and center the top image.
        using (MagickImageCollection images = new MagickImageCollection())
        {
            MagickImage from = new MagickImage(strTempFile);

            Point newP = GetMinRatio(from.Height, from.Width, MaxHeight, MaxWidth);

            MagickImage first = new MagickImage(Color.White, newP.X, newP.Y);
            first.Density = new MagickGeometry(300, 300);
            first.BitDepth(24);
            if (first.ColorSpace != ColorSpace.sRGB && first.ColorSpace != ColorSpace.RGB)
            {
                first.AddProfile(ColorProfile.SRGB);
                first.ColorSpace = ColorSpace.sRGB;
            }
            if (strNewExt.ToLower() == ".tiff"
            || strNewExt.ToLower() == ".tif")
            {
                first.CompressionMethod = CompressionMethod.LZW;
                first.Format = MagickFormat.Tiff;
            }
            if (strNewExt.ToLower() == ".jpeg" || strNewExt.ToLower() == ".jpg")
            {
                first.CompressionMethod = CompressionMethod.LosslessJPEG;
            }

            images.Add(first);

            images.Add(from);

            MagickImage result = images.Merge();
            result.Density = new MagickGeometry(300, 300);
            result.BitDepth(24);
            if (result.ColorSpace != ColorSpace.sRGB && result.ColorSpace != ColorSpace.RGB)
            {
                result.AddProfile(ColorProfile.SRGB);
                result.ColorSpace = ColorSpace.sRGB;
            }
            if (strNewExt.ToLower() == ".tiff"
            || strNewExt.ToLower() == ".tif")
            {
                result.CompressionMethod = CompressionMethod.LZW;
                result.Format = MagickFormat.Tiff;
            }
            if (strNewExt.ToLower() == ".jpeg" || strNewExt.ToLower() == ".jpg")
            {
                result.CompressionMethod = CompressionMethod.LosslessJPEG;
            }
            result.Write(strFileName);
        }

New Post: Converting a PDF to JPG and then scaling turns the image black

$
0
0
This happens with every PDF I try. Here's an example:

http://msiatlanta.com/kb/index.php?View=file&EntryID=3
        MagickReadSettings settings = new MagickReadSettings();
        settings.Density = new MagickGeometry(144, 144);
        foreach(string PDF in PDFs)
        {
            using(MagickImageCollection images = new MagickImageCollection())
            {
                images.Read(PDF, settings);
                int page = 1;
                foreach (MagickImage image in images)
                {
                    image.Write(PDF.Substring(0, PDF.Length - 4)+" Page "+page+".jpg");
                    page++;
                }
                images[0].Scale(95.0, 95.0);
                images[0].Write(PDF.Substring(0, PDF.Length - 4) + " High.jpg");
            }
        }
This code creates images of each PDF page and creates a scaled down image of the first page. However, the scaled down image turns black like so:

http://i.imgur.com/GuoWM0g.png

New Post: Converting a PDF to JPG and then scaling turns the image black

$
0
0
This is happening because the background of your PDF is transparent. When you save it as JPEG this will turn black for your PDF's. You should change the transparent pixels to a color with the ColorAlpha method:
foreach (MagickImage image in images)
{
  image.ColorAlpha(new MagickColor("#fff"));
  image.Write(fileName.Substring(0, fileName.Length - 4) + " Page " + page + ".jpg");
  page++;
}

New Post: Block Processing For Large Images

$
0
0
I used image.GetReadOnlyPixels to 'Clone' parts of the image but I am unable to reproduce the code from the posted example. I think you will have to do some trials for yourself to see if you can get it working.

New Post: Merging Images Together

$
0
0
I think you can do this much easier with the Extent method of MagickImage.
MagickImage image = new MagickImage(strTempFile);
image.Extent(width, height, Gravity.Center, new MagickColor("#fff"));

New Post: Color Profile is null. I might be missing something

$
0
0
Using the following image, the color profile at the end(cp1) is null when reading after a conversion.

https://www.dropbox.com/s/hntk98bk2qp4gan/8632_168.jpg

The code is:
        var destinationStream = new FileStream("test.png", FileMode.Create);

        //this is the image in dropbox
        string sourceFilePath = "sourceFile"

        MagickImage magickImage1 = new MagickImage(sourceFilePath);

        magickImage1.Strip();
        magickImage1.Format = MagickFormat.Png;
        magickImage1.Density = new MagickGeometry(300, 300);

        destinationStream.SetLength(0);
        magickImage1.Write(destinationStream);

        MagickImage magickImageDestination;

        destinationStream.Seek(0, SeekOrigin.Begin);
        magickImageDestination = new MagickImage(destinationStream);

        MagickImage magickImageSource = new MagickImage(sourceFilePath);

        ColorProfile cp = magickImageSource.GetColorProfile();

        if (cp != null)
        {
            magickImageDestination.AddProfile(cp);
        }

        destinationStream.SetLength(0);

        try
        {
            magickImageDestination.Write(destinationStream);
        }
        catch (Exception e)
        {

        }

        destinationStream.Seek(0, SeekOrigin.Begin);
        MagickImage mi = new MagickImage(destinationStream);

        ColorProfile cp1 = mi.GetColorProfile();

New Post: Merging Images Together

$
0
0
That worked. Is this documented anywhere? It would have saved a ton of time to know about the 'Extent' command.

New Post: Merging Images Together

New Post: Embedded ICC profile issue

Viewing all 3693 articles
Browse latest View live


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