Problems with resizing a previously rendered label
-
- Posts: 23
- Joined: 2016-12-08T19:43:17-07:00
- Authentication code: 1151
Problems with resizing a previously rendered label
Okay so I have the newest version of ImageMagick installed on Windows 10 Pro 64-bit. I run this command
magick -background none -fill #ff0000 -font Arial -size x90 -gravity center label:"ALBUQUERQUE" png32:C:\Users\Nope\Desktop\asdf.png
And then I resize it (note that this command is applied to a crapton of labels all at difference sizes)
magick C:\Users\Nope\Desktop\asdf.png -resize 240x90^>! C:\Users\Nope\Desktop\asdf.png
If you run this command, you will see that the resized image looks all aliased and gross. Is there a way to keep this from happening?
magick -background none -fill #ff0000 -font Arial -size x90 -gravity center label:"ALBUQUERQUE" png32:C:\Users\Nope\Desktop\asdf.png
And then I resize it (note that this command is applied to a crapton of labels all at difference sizes)
magick C:\Users\Nope\Desktop\asdf.png -resize 240x90^>! C:\Users\Nope\Desktop\asdf.png
If you run this command, you will see that the resized image looks all aliased and gross. Is there a way to keep this from happening?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Problems with resizing a previously rendered label
The result I get isn't aliased.
The image has been halved in width, so the letters are narrowed and pushed together. It may look better if you choose a font that already has narrow letters.
The image has been halved in width, so the letters are narrowed and pushed together. It may look better if you choose a font that already has narrow letters.
snibgo's IM pages: im.snibgo.com
-
- Posts: 23
- Joined: 2016-12-08T19:43:17-07:00
- Authentication code: 1151
Re: Problems with resizing a previously rendered label
Wait. How are you getting a different result than me?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problems with resizing a previously rendered label
What is your exact IM version? What do you get from
Perhaps you have an older delegate for freetype or fontconfig?
Code: Select all
convert -version
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problems with resizing a previously rendered label
I think your problem is with 240x90^>! I do not think you can use ! with ^>. They mean two different things.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problems with resizing a previously rendered label
On windows ^ is a special character an I think needs escaping as ^^
Or were you just escaping > as ^>?
Or were you just escaping > as ^>?
-
- Posts: 23
- Joined: 2016-12-08T19:43:17-07:00
- Authentication code: 1151
Re: Problems with resizing a previously rendered label
The -resize -240x90^>! argument is there simply to resize any images LARGER than 240x90 pixels down to 240x90 pixels without paying regard to the aspect ratio. If I remove the caret, it doesn't seem work properly.
And here is what magick -version returned
And here is what magick -version returned
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problems with resizing a previously rendered label
The carat in IM means to display to conform to the smaller dimension. The > means only if the image is greater than that size. The ! means exactly to the dimensions you have. But in Windows, the ^ has a special meaning as an escape character. So your command as written is confusing to me and perhaps IM on Windows. In Windows syntax, you are escaping the >. Perhaps that is what you want. If you want it to check the smaller dimension, then it would need to be ^^>!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problems with resizing a previously rendered label
In unix (IM 7.0.4.7 Q16 Mac OSX), with the following, I get:
This assumes you are not interested in conforming to the smaller dimension via ^ ( or in windows ^^)
If you are, then I use:
Code: Select all
magick -background none -fill "#ff0000" -font Arial -size x90 -gravity center label:"ALBUQUERQUE" png32:asdf.png
Code: Select all
magick asdf.png -resize 240x90>! tmp.png
If you are, then I use:
Code: Select all
magick asdf.png -resize 240x90^>! albuqueque2.png
-
- Posts: 23
- Joined: 2016-12-08T19:43:17-07:00
- Authentication code: 1151
Re: Problems with resizing a previously rendered label
Okay let me re-explain. If the input image is larger than 240x90 pixels, resize to 240x90 pixels without respecting the aspect ratio. Here are all forms of arguments I tried.
240x90>!
The dimensions are 240x37 so nope. Bad combo.
240x90^>!
Dimensions are 240x90 so yes. This is what we want.... except that the output is downright ugly.
240x90^^>!
Dimensions are 590x90. Identical to the original. Nope.
240x90>^!
Dimensions are 240x37. Same as the first resize.
240x90\>!
Dimensions are 240x37. Same as above.
240x90>\!
Returns Access is Denied. I'm guessing this isn't the way to go.
I'm not entirely sure what is going on.
240x90>!
The dimensions are 240x37 so nope. Bad combo.
240x90^>!
Dimensions are 240x90 so yes. This is what we want.... except that the output is downright ugly.
240x90^^>!
Dimensions are 590x90. Identical to the original. Nope.
240x90>^!
Dimensions are 240x37. Same as the first resize.
240x90\>!
Dimensions are 240x37. Same as above.
240x90>\!
Returns Access is Denied. I'm guessing this isn't the way to go.
I'm not entirely sure what is going on.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problems with resizing a previously rendered label
You appear to be on Windows from your C:\. So you need to use Windows syntax. In Windows ^ is escape and so your original command was escaping the >. If you really want the IM ^, then you must escape it to ^^. See http://www.imagemagick.org/script/comma ... p#geometry for the meaning of ^, >, ! in IM.
-
- Posts: 23
- Joined: 2016-12-08T19:43:17-07:00
- Authentication code: 1151
Re: Problems with resizing a previously rendered label
Okay let's start from scratch. If I want to resize the image to 240x90 without respecting the aspect ratio and while retaining image quality, how do I make it so. I only stuck with the caret because it got my image down to the desired dimensions but I just couldn't figure out why it looked hideous.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Problems with resizing a previously rendered label
What happens when you use just a "!" ? What does your original look like, before resizing?
snibgo's IM pages: im.snibgo.com
-
- Posts: 23
- Joined: 2016-12-08T19:43:17-07:00
- Authentication code: 1151
Re: Problems with resizing a previously rendered label
Here is the original
Just doing -resize 240x90! gets me this
The dimensions are 240x90 which is exactly what I want. I just can't have it looking like garbage.
This image was done on a different computer running a different version of IM with a different and less stable font although the process was identical.
I did try using this font on my computer with the newest release of IM and it looks like garbage.
Just doing -resize 240x90! gets me this
The dimensions are 240x90 which is exactly what I want. I just can't have it looking like garbage.
This image was done on a different computer running a different version of IM with a different and less stable font although the process was identical.
I did try using this font on my computer with the newest release of IM and it looks like garbage.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problems with resizing a previously rendered label
Check your version of freetype? Also perhaps you got a bad set of glyphs in the Arial font you downloaded or are using. I do not see aliasing except in your middle imager above. Perhaps your arial font is set to Arial narrow?. Check your fonts by
You can find your version of freetype by
TTC* TTF r-- TrueType font collection (Freetype 2.6.5)
TTF* TTF r-- TrueType font (Freetype 2.6.5)
Code: Select all
convert -list font
Code: Select all
convert -list format
TTC* TTF r-- TrueType font collection (Freetype 2.6.5)
TTF* TTF r-- TrueType font (Freetype 2.6.5)