Quicker ways to combine two images in Magick.net #827
Unanswered
herbertgzb
asked this question in
Help
Replies: 1 comment 12 replies
-
Without your images I cannot really give you a good answer. I suspect that the compression is what is making it take the 1.5s on your machine. |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The task I am going through is rather straightforward -- I need to read either a GROUP IV tiff image or a jpeg image. I then need to either cut a slice in the that image or to annotate it. Either way -- using magick.net I would think the first task is to cut the image into two pieces (top and bottom) and cut out the middle part, and combine them. The second task would be to create a canvas and write on that canvas with the original image and the annotation.
A sample code for the first task would be like this (after I have
Up to the "IMAGE.Write(outputpath)" line, everything took around 80ms. The final line takes around 1500ms/1.5s either writing on network share or locally.
If the task is simpler/not involving combining the two images together, aka, like below
The above code takes around 80ms to finish. Note that -- the image_top contains most of the whole image (image top is around 3100 pixels while image_bottom is around 100 pixels). So I don't think size itself is the problem here.
I have also tried the composite method (I believe for annotation I'll use the same method)
And again -- the last step take 1.5s vs everything before the IMAGE.Write(outputpath) line taking less than 80ms.
Wonder if I can do anything to make the whole process quicker?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions