Page 2 of 2

Re: How to reduce the time taken by MagickWand methods

Posted: 2020-04-12T10:36:11-07:00
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

Re: How to reduce the time taken by MagickWand methods

Posted: 2020-04-12T13:03:13-07:00
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?

Re: How to reduce the time taken by MagickWand methods

Posted: 2020-04-12T14:53:29-07:00
by magick
Add

Code: Select all

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

Code: Select all

MagickReadImage(magick_wand,argv[1]);

Re: How to reduce the time taken by MagickWand methods

Posted: 2020-04-12T22:30:21-07:00
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

Re: How to reduce the time taken by MagickWand methods

Posted: 2020-04-13T08:13:02-07:00
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.