How to reduce the time taken by MagickWand methods

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: How to reduce the time taken by MagickWand methods

Post by magick »

With JPEG yes. Set the JPEG size property. From the command-line it looks like this:

Code: Select all

$ time convert -define jpeg:size=1000x1000 image3.jpg -resize 1000x1000 image.png
2.249u 0.105s 0:01.58 148.1%    0+0k 0+2432io 0pf+0w

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

Re: How to reduce the time taken by MagickWand methods

Post by ArunKumar »

magick wrote:
2020-04-12T10:36:11-07:00
With JPEG yes. Set the JPEG size property. From the command-line it looks like this:

Code: Select all

$ time convert -define jpeg:size=1000x1000 image3.jpg -resize 1000x1000 image.png
2.249u 0.105s 0:01.58 148.1%    0+0k 0+2432io 0pf+0w
MagickWand method to do this?

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: How to reduce the time taken by MagickWand methods

Post by magick »

Add

Code: Select all

MagickSetOption(magick_wand,"jpeg:size","1000x1000");
just before

Code: Select all

MagickReadImage(magick_wand,argv[1]);

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

Re: How to reduce the time taken by MagickWand methods

Post by ArunKumar »

ArunKumar wrote:
2020-04-12T13:03:13-07:00
magick wrote:
2020-04-12T10:36:11-07:00
With JPEG yes. Set the JPEG size property. From the command-line it looks like this:

Code: Select all

$ time convert -define jpeg:size=1000x1000 image3.jpg -resize 1000x1000 image.png
2.249u 0.105s 0:01.58 148.1%    0+0k 0+2432io 0pf+0w
MagickWand method to do this?
What is -define jpeg:size=1000x1000 doing ?
Will this reduce the Quality of the image? Because I need no compromise in Quality
How the time is reduced ?
Will this is efficient?
Please answer my all Question

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: How to reduce the time taken by MagickWand methods

Post by magick »

With the jpeg:size option, we are providing the JPEG delegate library with a hint of the size we want. You would need to refer to the JPEG documentation or ask the JPEG delegate library developers for for how scaling is accomplished and its effect on the quality of the results. To get started, look for "Scale the image by the fraction scale_num/scale_denom" @ https://github.com/LuaDist/libjpeg/blob ... ibjpeg.txt.

Locked