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

New Post: DPX Image Format to TIFF not work?

$
0
0
My software is a Digital Cinema Mastering program, so for a movie it processes up to 300k images,
to save the images first as png it would take too much time for this amount of images :)

Exist a older version of magick.net without HDRI?

New Post: DPX Image Format to TIFF not work?

$
0
0
With that amount of images I would also say no to the work around. Magick.NET 6.8.6.801 does not have HDRI enabled but I would really advise you to switch back to the newest version once this bug has been fixed. There have been a lot of bug fixes / improvements since that version.

New Post: DPX Image Format to TIFF not work?

$
0
0
ok i will switch to the new version if the bug is fixed....

New Post: DPX Image Format to TIFF not work?

$
0
0
The problem has been found and will be fixed in the next release. I have a better work around for your situation now. Call the Clamp method before you set the BitDepth

New Post: How to overlay a tiled pattern on a solid background?

$
0
0
I have a background/canvas with a solid color. I want to overlay a pattern on top of that background. I want to set the opacity of the tiled pattern too.

This is what I have
    MagickImage pattern = new MagickImage("connect.png");
    pattern.Alpha(AlphaOption.Set);
    pattern.QuantumOperator(Channels.Alpha, EvaluateOperator.Set, Quantum.Max / 2);

    using (MagickImage wallpaper = new MagickImage(new MagickColor("#2980b9"),1440,900)) {
        wallpaper.Composite(pattern,0);
        wallpaper.Write("result.png");
    }
    pattern.Dispose();
I am getting a solid background and the pattern is on the upper left of the image. The opacity is not set. What else do I have to do?

New Post: How to overlay a tiled pattern on a solid background?

$
0
0
Can you post a message with a command line example and a link to your image? I don't really understand what you are trying to do.

New Post: How to overlay a tiled pattern on a solid background?

$
0
0
original pattern :

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

background color of base canvas is #2980b9.

Output Image of the code above is

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


I want to achieve this:

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


I am not sure how to do this in command line but in order to tile the square image on the center from the first link . I must use the -tile command line option to compose the tiled background as explained here http://www.imagemagick.org/Usage/canvas/#tile. But, I don't know how to execute the tile parameter in this library. I hope you can help me. Thanks for replying.

New Post: How to overlay a tiled pattern on a solid background?

$
0
0
There is not support for the tile operator in Magick.NET yet. You could accomplish the same output image if you tile the image yourself. You could start with an output image of the same size as your original image and use the MagickImageCollection class to combine your images. You can create a duplicate with the Clone method. And then use AppendHorizontally/AppendVertically of the MagickImageCollection to combine your images. I will look into ImageMagick to see how the tile command works and see if I can add it.

New Post: How to overlay a tiled pattern on a solid background?

$
0
0
dlemstra wrote:
There is not support for the tile operator in Magick.NET yet. You could accomplish the same output image if you tile the image yourself. You could start with an output image of the same size as your original image and use the MagickImageCollection class to combine your images. You can create a duplicate with the Clone method. And then use AppendHorizontally/AppendVertically of the MagickImageCollection to combine your images. I will look into ImageMagick to see how the tile command works and see if I can add it.
Thanks for clearing that out, I finally used gdi+ for the tiling part

New Post: How to overlay a tiled pattern on a solid background?

$
0
0
It turns out there is already a method called Texture for what you are trying to do. You can accomplish the output image with the following code:
using (MagickImage pattern = new MagickImage("connect.png"))
{
  pattern.Alpha(AlphaOption.Set);
  pattern.QuantumOperator(Channels.Alpha, EvaluateOperator.Set, Quantum.Max / 2);

  using (MagickImage wallpaper = new MagickImage(new MagickColor("#2980b9"), 1440, 900))
  {
    wallpaper.Texture(pattern);
    wallpaper.Write("test.png");
  }
}

New Post: How to overlay a tiled pattern on a solid background?

$
0
0
Thanks for your help , that indeed is cleaner. This is how I did it with gdi+ if anyone is interested
    Bitmap tilePatternBitmap = new Bitmap("connect.png");
    Bitmap tiledPatternBitmap = new Bitmap(1440, 900);

    using (TextureBrush brush = new TextureBrush(tilePatternBitmap, WrapMode.Tile))
    using (Graphics g = Graphics.FromImage(tiledPatternBitmap))
    {
        g.FillRectangle(brush, 0, 0, tiledPatternBitmap.Width, tiledPatternBitmap.Height);
    }

    MagickImage pattern = new MagickImage(tiledPatternBitmap);
    pattern.Alpha(AlphaOption.Set);
    pattern.QuantumOperator(Channels.Alpha, EvaluateOperator.Set, Quantum.Max / 2);

    using (MagickImage wallpaper = new MagickImage(new MagickColor("#2980b9"),1440,900)) {
        wallpaper.Composite(pattern, Gravity.Center, CompositeOperator.Dissolve, "50");
        wallpaper.Write("test.png");
    }
    pattern.Dispose();

New Post: Does Magick.Net support "caption:" functionality?

$
0
0
I am playing around with Magick.NET to see if it might meet the needs of our software. So far it looks great. However, one of the requirements is to be able to draw a textbox of a specific width/height and place text inside the box so that the text is word-wrapped to fit inside the box. It looks like the ImageMagick "caption:" functionality meets this need, but I can't figure out how to get this to work with Magick.Net. I don't see "Caption" as an function or class in the API.

Any help is appreciated!

I am using Magick.NET 6.8.7.901, and I installed it via zip.

New Post: Does Magick.Net support "caption:" functionality?

$
0
0
If you want to use the caption: coder you should do the following:
// convert.exe caption:'ImageMagick Rules OK!' caption_centered.gifusing (MagickImage image = new MagickImage())
{
  // Set options like background / font / color
  image.Read("caption:\"ImageMagick Rules OK\"'");
  image.Write("caption_centered.gif");
}

New Post: Does Magick.Net support "caption:" functionality?

$
0
0
Thank you, this helps. However, your sample is creating a new image. I want to load an existing tiff, then draw a rectangle on it with a caption inside, then save as a new tiff. I'm not sure how I can do that with your example (?).

Also, for future reference, how would I have known that I can use the Read function with a caption? I just want to make sure I'm not missing some documentation somewhere (I did read through the Magick.Net examples). Thanks!

New Post: how to set image opacity by percentage?

$
0
0
Will this work or is there a cleaner way to do this?
MagickImage pattern = new MagickImage("image.png");
pattern.Alpha(AlphaOption.Set);
var Divisor = Quantum.Max / (Quantum.Max * PercentageF)
pattern.QuantumOperator(Channels.Alpha, EvaluateOperator.Set, Quantum.Max / Divisor);

New Post: Does Magick.Net support "caption:" functionality?

$
0
0
I have added a link to a great ImageMagick examples page in the documentation. You can recognize that you need the Read method when you see a colon in the examples and no file is being read. For example this:
convert.exe caption:'ImageMagick Rules OK!' caption_centered.gif (http://www.imagemagick.org/Usage/text#caption)
convert.exe rose: rose.png (http://www.imagemagick.org/Usage/files/#special_formats)
If you want to draw text on an existing image you could use the Drawable classes to accomplish this. But because you want the word wrapping you will have to 'Read' the caption and compose it over your existing image.
using (MagickImage image = new MagickImage("image.tif"))
{
  using (MagickImage text = CreateCaption("caption:Magick.NET"))
  {
    // http://www.imagemagick.org/Usage/compose/#over
    image.Composite(text, 50, 50, CompositeOperator.Over);
  }
}

New Post: how to set image opacity by percentage?

$
0
0
This is the cleanest way to do this. The QuantumOperator method is the method you need when you want to do some quick and simple pixel operations.

New Post: Scaling large images

$
0
0
Thank you for answer.
I'm using folowwing code:
MagickNET.SetCacheThreshold(int.MaxValue);
MagickNET.SetTempDirectory(@"D:\");
using (var img = new MagickImage(@"D:\sample.psd"))
{
    img.ColorType = ColorType.Grayscale;
    img.IsMonochrome = true;
    img.Scale(img.Width * 4, img.Height * 4);
    img.Write(@"D:\resultImage.psd");
}
For sample file application creates 2 temp files with size of 580 Mb and 9.2 Gb and it takes 824 seconds to proceed image. Application doesn't utilize memory but uses disk a lot.

New Post: Scaling large images

$
0
0
Also tried to do the same with imagemagick command line tool, took about 10 seconds and utilized cpu (13%) and memory(1.8 Gb).

New Post: Scaling large images

$
0
0
I can reproduce this, I will look into it later today.
Viewing all 3693 articles
Browse latest View live


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