How can I get a fine image after image resizing with v6.4.5?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
djshin

How can I get a fine image after image resizing with v6.4.5?

Post by djshin »

Hi, everyone!!

We upgraded the version of ImageMagic on unix machine from 5.2 to 6.4.5 last month.
I used the function "ScaleImage(image, scaled_x, scaled_y, &exception)".

When I used the 5.2 version I could get fine image after resizing 'jpg to jpg' or 'tiff to tiff',
but when I used the 6.4 version the quality of result image was very poor.

So, we changed the source code to get a fine image like below,
1. convert source image(.jpg or .tiff) to ".bmp" image
2. resize bmp image to target image(.jpg or .tiff)

We could get a fine image but this way takes too much system loads especially disk I/O and takes very long time to change image.

How can I get a fine image after resizing by 6.4.5 version with less system loads?

I want to know how to resize image without bmp conversion and quality loss.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How can I get a fine image after image resizing with v6.4.5?

Post by anthony »

Try increasting -quality level for JPEG compression.


What do you mean by 'fine image'????
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
djshin

Re: How can I get a fine image after image resizing with v6.4.5?

Post by djshin »

anthony wrote:Try increasting -quality level for JPEG compression.


What do you mean by 'fine image'????
Thanks for your answer!!
I visited example site, and found that you also have a trouble to resize line drawings.
What I do is resizing line drawings.

I tried lots of different options to success, but I failed for every trial.
Can you show me what was the best options to resize line drawings from your experiences.

Thank you!!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How can I get a fine image after image resizing with v6.4.5?

Post by fmw42 »

can you post an example?
djshin

Re: How can I get a fine image after image resizing with v6.4.5?

Post by djshin »

fmw42 wrote:can you post an example?
This is the original TIF image that I want to resize smaller than original image 50%.

http://mfiles.naver.net/64b551859fc3a91 ... gghost.tif


Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How can I get a fine image after image resizing with v6.4.5?

Post by anthony »

I downloaded it so it is present now.

Hmm yes a line drawing.

I think the best way may be to try and thicken the lines a bug first.

For example
convert jtest-egghost.tif -blur 1x65000 -threshold 80% \
-resize 50% smaller_line_drawing.tif

for squarer corners change the threshold to 99% or 99.999%
(do not use 100%!)

This operation is a but like a 'morphological' binary operation of 'erode' with a 9x9 square neighborhood. That is any pixel that has a black neighbor is to be set to black, thus thickening the lines by two pixels.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How can I get a fine image after image resizing with v6.4.5?

Post by fmw42 »

djshin wrote:
fmw42 wrote:can you post an example?
This is the original TIF image that I want to resize smaller than original image 50%.

http://mfiles.naver.net/64b551859fc3a91 ... gghost.tif


Thanks.

Seems I cannot download this file. But as Anthony mentioned you can thicken the lines before reducing the size. You can do as he suggests or you can try my morphology script at http://www.fmwconcepts.com/imagemagick/index.html with several iterations of erode if the lines are black on white background or dilate if white lines on black background.
Post Reply