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

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

$
0
0
The png coder automatically removes the color profile from your image. If you want to keep it you should set the following define before reading and before writing the image.
try
{
  magickImageDestination.SetDefine(MagickFormat.Png, "preserve-iCCP", true);
  magickImageDestination.Write(destinationStream);
}
catch (Exception e)
{
}

destinationStream.Seek(0, SeekOrigin.Begin);
MagickImage mi = new MagickImage();
mi.SetDefine(MagickFormat.Png, "preserve-iCCP", true);
mi.Read(destinationStream);

ColorProfile cp1 = mi.GetColorProfile();
p.s. You will get color coding when you put 'C#' behind ``` that starts a code block.

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

$
0
0
Thanks.

Do I need to use that only when converting to png? Are there similar things I need to do/set when converting/reading other file types, like jpg, pdf, etc.?

New Post: Merging Images Together

$
0
0
Oh, that would have been handy!! Thanks!

New Post: Stuck Porting Script

$
0
0
I'm porting Fred's maxima script (http://www.fmwconcepts.com/imagemagick/maxima/index.php) because I can't figure out this part:
match=`compare -metric $metric $subimagesearch $dir/tmpI.mpc \( -size 1x1 xc:"gray($valpct%)" \) null: 2>&1`
I think I understand that I can do img.SubImageSearch() and that works fine but it only returns the best match. I really need all matches and their confidence values in a collection that I can iterate through. I have found nothing to do this so this is why I resort to maxima.

I've done this to create the gray color with the value percent. The problem is that img.SubImageSearch() doesn't seem to return a percent. There is a SimilarityMetric but that doesn't look right.
MagickColor graylevel = new MagickColor("xc:gray(" + percent + ")");
MagickImage gray1x1 = new MagickImage(graylevel,1,1);
Fred's routine outputs data like this
DSCHROEDER /d/apps/ImageMagick-6.8.8-Q16
$ ./maxima -r 3 -n 5 -u p -m rmse -g -t 90 hat.jpg hat_out5.png
787,72 gray=60395,235,92.1569%
787,42 gray=59624,232,90.9804%
818,42 gray=59110,230,90.1961%
where the first value is X,Y and gray is listed in 3 types.

Perhaps the real question is how to use these xc: -format "%[]" info: commands in Magick.NET.
val=`convert $dir/tmpI.mpc -format "%[$maximum]" info:`
valfrac=`convert xc: -format "%[fx:$val/$qrange]" info:`
valpct=`convert xc: -format "%[fx:100*$val/$qrange]" info:`
val8=`convert xc: -format "%[fx:round(255*$valfrac)]" info:`
Once I can get the value output from the format info commands the perpaps i can pass in the gray percent to make my color to do a subimage search.

Darren

New Post: Embedded ICC profile issue

$
0
0
I can load this image without issue in IM.Net. Are you saying you're still having problems with it? This image is, in fact, Color RGB with an ICC Profile of "Adobe RGB (1998)" even though it looks gray.

Darren

New Post: Embedded ICC profile issue

$
0
0
I'm able to open the original in Photoshop without issue. If I use the code above, the resulting image(.jpg) gives me the embedded ICC message in Photoshop.

It appears that I am able to get around the above Photoshop error by adding the following line before I write it to the destination Stream at the end:

magickImageDestination.ColorType = ColorType.TrueColor;

Now, to be clear, and I'm sure you know by now, I'm not an image expert. So I am not sure if the above line produces results that are unfavorable in other ways.

New Post: Stuck Porting Script

$
0
0
You can use the FormatExpression method of MagickImage for this.
using(MagickImage image  = new MagickImage(@"c:\yourdir\tmpI.mpc"))
{
  string val = image.FormatExpression("%[" +maximum + "]");
}

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

$
0
0
I am only aware of the png coder doing this. I know jpg and pdf don't do this but there might be other formats that also do this.

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

$
0
0
Great. And for my own knowledge, do you know why the png coder does this? And not a problem if you don't know. It's more of just a curiosity on my part.

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

$
0
0
I did not know the answer to that question so I contacted the original developer of the png coder and I got the following answer:
It only removes them when it discovers that the profile can be replaced with the sRGB chunk. If the profile represents something
other than the sRGB profile, it will be preserved, unless it is being discarded for another reason such as Strip().

New Post: Stuck Porting Script

$
0
0
And if you want to use that script commercially please contact Fred. Even if you port the script you still have to pay a license fee if you want to use his script commercially.

New Post: Open raw images

$
0
0
I used StillLife.CR2 from Magick.NET.Samples\Samples\Magick.NET\Files\ in source code.
Command line in cmd creates output.ppm without any errors or warnings.
It looks strange for me that inner exception in my project leaves this "%u.ppm" "%i"' instead of showing real files path. Isn't it a problem?

Also tried to run ReadRawImageFromCameraSamples.ConvertCR2ToJPG() from samples. Same result :(

New Post: Open raw images

$
0
0
I can reproduce the problem if I use the AnyCPU version of Magick.NET. Not sure why this is happening but I will figure out why this bug is happening and fix it for you.

New Post: Open raw images

$
0
0
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.

New Post: No such file or directory @ error/pdf.c/ReadPDFImage/713

$
0
0
Hi again!

I'm using Magick.NET-6.8.8.1001-Q16-AnyCPU-net40-client to convert a pdf to png.

I have the following code to do it:
Dim settings As New MagickReadSettings()
                    settings.Density = New MagickGeometry(300, 300)

                    Using images As New MagickImageCollection()
                        images.Read(sPlantillaRellena, settings)
                        Dim horizontal As MagickImage = images.AppendHorizontally()
                        horizontal.Write(sRutaImagen)
                        images.Dispose()
                    End Using
                    settings = Nothing
The 'sPlantillaRellena' variable is the pdf saved in a shared folder in a server and the 'sRutaImagen' variable is the png to be saved in a shared folder in a server.

I have already Ghostscript 9.14 for Windows 64 bit.

This code is working until today. But today, the application show the next error:
Magick: PostscriptDelegateFailed `\\carpetaCompartida\file_fill_1.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/713
We run the application in IIS 7 and we have an application pool, which is recycled every nigth.

What could be the problem?

Thanks in advance.

New Post: No such file or directory @ error/pdf.c/ReadPDFImage/713

$
0
0
Can you upgrade to the latest version and try again? You should get a better error message in the latest version.

New Post: No such file or directory @ error/pdf.c/ReadPDFImage/713

New Post: No such file or directory @ error/pdf.c/ReadPDFImage/713

$
0
0
I meant the latest version of Magick.NET, the version you are using is not the latest.

New Post: No such file or directory @ error/pdf.c/ReadPDFImage/713

$
0
0
Hi again!

I have updated to the latest version and I haven't get the previous error, but now when I run the application in two different computers I get this error Object reference not set to an instance of an object when I create Dim horizontal As MagickImage = images.AppendHorizontally()
I have checked that the 'images' object is not nothing and the pdf is also created.

What could be the problem?

Thanks in advance.

New Post: No such file or directory @ error/pdf.c/ReadPDFImage/713

$
0
0
I just added a simple unit test to see if there was a problem with the AppendHorizontally but that seems to work correctly. Are you using the collection after it has been Disposed? For example this:
Using images AsNew MagickImageCollection()
  images.Read(sPlantillaRellena, settings)
  images.Dispose() ' You also don't need to do this because of the using statement...Dim horizontal As MagickImage = images.AppendHorizontally()
  horizontal.Write(sRutaImagen)
EndUsing
Viewing all 3693 articles
Browse latest View live


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