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

New Post: Overwrite iptc profile

$
0
0
That commit is not there, it is in the repository of ImageMagick. I did not rebuild Magick.NET yet with the new source code of ImageMagick. If this is really urgent for you (next release will be tomorrow or this weekend) then please contact me through CodePlex from my profile page and I can send you a development build.

New Post: Not converting to PDF properly

$
0
0
Using this image: https://www.dropbox.com/s/vfli58sxzmywcy3/22525_008_0030_CC.tif

In the following code, on the last line, the format of the image(magickImageNew ) is .png when it should be .pdf:
        var destinationStream = new FileStream("test.pdf", FileMode.Create);

        //this is the image in dropbox
        string sourceFilePath = @"C:\22525_008_0030_CC.tif";

        MagickImage magickImage1 = new MagickImage(sourceFilePath);

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

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

        MagickImage magickImageNew;

        destinationStream.Seek(0, SeekOrigin.Begin);
        magickImageNew = new MagickImage(destinationStream);
Let me know if you need more information or if I am missing something.

Thanks, Tim

New Post: Not converting to PDF properly

$
0
0
You have found a bug in ImageMagick. Thank you for reporting this. I just submitted a patch to the ImageMagick repository. This will be fixed in the next release of Magick.NET.

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
Can you please reply to the e-mail I send you through Codeplex? We need a bit more information.

New Post: Not converting to PDF properly

$
0
0
You may not know this currently, but any idea if this bug is constrained only to converting to .pdf's, or might it involve more conversion types?

New Post: Change DPI (resolution) but keep same size

$
0
0
Hi

Thank you for the reply, this is really helpful.

I have one more question, sorry for my poor knowledge, but how can i convert image to "GreyScale" using Magick.Net?
I tried a couple approach but was unsuccessful.

Thank you,

HITESH.
PPlease consider the environment before printing this e-mail, thank you.




New Post: Not converting to PDF properly

$
0
0
It is limited to a small set of image types that cannot read directly from a memory blob. It this case it is happening because Magick.NET uses Ghostscript to convert the PDF. The following is happening:
  1. Format of data in stream is checked.
  2. If PDF then write the data of the stream to a temporary file.
  3. Tell Ghostscript to convert the PDF to a PNG file.
  4. Read PNG files and return image.
As you can see the PNG format is used in step 3 and the fix I added will set the format to PDF in step 4.

New Post: ImageMagick reads/converts TrueColor TIF as Grayscale?

$
0
0
Hi, I have an uncompressed 24bit Tif image and I want it to stay TrueColor however:
using (MagickImage image = new MagickImage(@"F:\wireframe.tif"))
{    
    ColorType ct = image.ColorType; //ColorType.Grayscale
    ColorSpace cs = image.ColorSpace; //ColorSpace.GRAY
             
    image.Write(@"F:\same_wireframe.tif");
}
The converted image is no longer true color but grayscale.
wireframe.tif size is: 480 678 bytes (400x400x3)
same_wireframe.tif size is: 160 470 bytes (400x400x1)
The Command Line version of Image Magick behaves the same way so maybe I post this in the wrong place?

It seems that I can’t attach the images in this discussion but the same thing happens with every 24bit image storing grayscale color information.
For example: I created a new RGB image in Gimp with white background than I painted to it with black paintbrush and exported it as uncompressed Tif.

Image Magick .Net
Type: Nuget Id: Magick.NET-Q8-x64 Version: 6.8.8.1001

Image Magick Command Line
7.0.0-0 Q16 x64 2014-01-19

New Post: Change DPI (resolution) but keep same size

$
0
0
You should set the ColorSpace of the image:
image.ColorSpace = ColorSpace.GRAY;

New Post: ImageMagick reads/converts TrueColor TIF as Grayscale?

$
0
0
Magick.NET does not use ImageMagick 7 yet so there could be some differences between Magick.NET and the command line. Feel free to post your questions that are related to ImageMagick here. I am also involved in that project. Can you post a link to your tif image so I can run some tests with it?

New Post: ImageMagick reads/converts TrueColor TIF as Grayscale?

$
0
0
Can I send it to you as an email attachment?

New Post: ImageMagick reads/converts TrueColor TIF as Grayscale?

$
0
0
Thank for your e-mail. I will look into it.

New Post: ERROR: Type 'ImageMagick.MagickImage' is not defined.

$
0
0
Good morning, I installed ImageMagick.Net with NuGet (Install-Package Magick.NET-Q8-x86) and it works correctly locally. However, when I compile and upload the files to the server, it gives the following error:
Compiler Error Message: BC30002: Type 'ImageMagick.MagickImage' is not defined.

Source Error:


Line 19:                 End If
Line 20: 
Line 21:                 Dim picture As New ImageMagick.MagickImage(Server.MapPath("~/mycube/img/") + uri)
Line 22:                 'Dim picture As New ImageMagick.MagickImage("C:\AppServ\www\hossman\" + uri)
Line 23: 
My code:
Public Class mycube
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try

            If Not Page.IsPostBack Then
                Dim uri As String = ""

                Try
                    uri = Request.QueryString("uri")
                Catch ex As Exception
                    uri = ""
                End Try

                If uri Is Nothing Then
                    Response.Write("")
                    Response.End()
                End If

                Dim picture As New ImageMagick.MagickImage(Server.MapPath("~/mycube/img/") + uri)

                Dim ancho As Integer = picture.Width()
                Dim alto As Integer = picture.Height()

                picture.BackgroundColor = ImageMagick.MagickColor.Transparent
                picture.MatteColor = ImageMagick.MagickColor.Transparent
                picture.VirtualPixelMethod = ImageMagick.VirtualPixelMethod.Transparent

                picture.Distort(ImageMagick.DistortMethod.Perspective, New Double() {0, 0, 2, 2, ancho, 0, 192, 1, ancho, alto, 193, 242, 0, alto, 2, 230})

                Dim fondo As New ImageMagick.MagickImage(Server.MapPath("~/mycube/img/") + "3dcubof.png")

                fondo.Composite(picture, 20, 16, ImageMagick.CompositeOperator.Over)
                fondo.BackgroundColor = ImageMagick.MagickColor.Transparent

                Dim buffer As New System.IO.MemoryStream
                fondo.ToBitmap().Save(buffer, System.Drawing.Imaging.ImageFormat.Png)
                Dim output = buffer.GetBuffer()
                Response.Clear()
                Response.ContentType = "image/png"
                Response.BinaryWrite(output)
                System.IO.File.Delete(Server.MapPath("~/mycube/img/") + uri)
                Response.End()
            End If
        Catch ex As Exception
            Response.Write(ex.Message)
        End Try
    End Sub

End Class
I do not know how to fix it ... I have checked that the dll is correctly generated in the bin folder, and as I said, on my local computer works correctly, only server failure (both locally and on the server I have. Net Framework 4.0).

Thank you very much for your help.

New Post: ERROR: Type 'ImageMagick.MagickImage' is not defined.

New Post: ERROR: Type 'ImageMagick.MagickImage' is not defined.

$
0
0
Surely that is the problem ... in any case it is a server hosting and I have no way of checking if Visual C++ is installed or not, and I can't install it ... it's a shame.

Thanks for your reply.

New Post: ImageMagick reads/converts TrueColor TIF as Grayscale?

$
0
0
It turns out that this change in colorspace is by design. ImageMagick detects the image can be changed to Grayscale. This will save space when the image is saved. If you want to get the original colorspace you should use the following code:
image.GetAttribute("tiff:photometric");

New Post: Change DPI (resolution) but keep same size

$
0
0
Thank you so much.

Appreciate your help.

Thank you,

HITESH.
PPlease consider the environment before printing this e-mail, thank you.




New Post: Combining two multi-page TIFF images

$
0
0
Hello,

I am trying to get Magick.NET to merge two multi-page tiff files into one multi-page tiff file. I am creating a MagickImageCollection variable for both of the tiff files I want to merge. Then, I create another MagickImageCollection that I will add them to. Unfortunately, I do not know how to put a collection inside of another collection. The Add function does not accept a Collection, and the Read function gets rid of the first one that is read in when I go to read the second in.

If someone could help, I would appreciate it. Thank you

Corbin

New Post: Combining two multi-page TIFF images

$
0
0
Hi I have to do the same thing so here is how I solved this:
public static void stackImages(string firstImagePath, string secondImagePath, string multiPagedImagePath)
{          
   using (MagickImageCollection multiPagedImage = new MagickImageCollection(firstImagePath))
   {
      multiPagedImage.Add(secondImagePath);
      multiPagedImage.write(multiPagedImagePath);
   }
}
You need only one collection which in this case represents one multi paged image.

I think you can also do this:
public static void stackImages(string[] imagePathsToInsert, string multiPagedImagePath)
{
     using (MagickImageCollection multiPagedImage = new MagickImageCollection())
     {
         foreach ( string imagePath in imagePathsToInsert)
         {
            multiPagedImage.Add(imagePath);
         }
     
         multiPagedImage.write(multiPagedImagePath);
    }
}
Make sure that the multiPagedImagePath extension is ".tif" because not every image format supports multi layer/page.

New Post: Combining two multi-page TIFF images

$
0
0
No problem at all, I appreciate your reply anyway.
Viewing all 3693 articles
Browse latest View live


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