Hi Guys,
I'm trying (and failing miserably) to get Imagemagick to replicate a task that I do in fireworks to create a 65x65px thumbnail image.
In fireworks I i take the original image, resize its smallest side to 65px (scaling the other side down equally so the image does not look squashed) and then i crop a 65x65px square from the centre of the image.
This essentially gives me the original image, but as a 65x65 thumbnail and keepign the ratio of the original image, but possibly with it's sides trimmed.
If that doesn't make sense let me know and i can provide some images.
creating square thumbnails regardless of picture ratio.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
See IM examples, Thumbnails.
You can either pad out the image, or chop off the offending edges.
You can either pad out the image, or chop off the offending edges.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: creating square thumbnails regardless of picture ratio.
I found this command:
convert -size 300x300 hatching.jpg \
-thumbnail x200 -resize '200x<' -resize 50% \
-gravity center -crop 100x100+0+0 +repage cut_to_fit.gif
It works for landscape photos, but not portrait.
I'm tyring to find the idea "crop to square" routine. The one I currently use involves padding it out, but, I'd rather it just crop off the edges.
convert -size 300x300 hatching.jpg \
-thumbnail x200 -resize '200x<' -resize 50% \
-gravity center -crop 100x100+0+0 +repage cut_to_fit.gif
It works for landscape photos, but not portrait.
I'm tyring to find the idea "crop to square" routine. The one I currently use involves padding it out, but, I'd rather it just crop off the edges.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: creating square thumbnails regardless of picture ratio.
It works find for me.
Though it does assume the photo has the correct orientation.
If you photo has NOT been auto-orientated add a -auto-orient before the -thumbnail operator.
Perhaps it is time a -resize-crop operator is added to IM to resize and crop and image to bebest fit the given size.
I'll add this to the 'furture proposals' page
Though it does assume the photo has the correct orientation.
If you photo has NOT been auto-orientated add a -auto-orient before the -thumbnail operator.
Perhaps it is time a -resize-crop operator is added to IM to resize and crop and image to bebest fit the given size.
I'll add this to the 'furture proposals' page
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: creating square thumbnails regardless of picture ratio.
Oh, my mistake, it is working. I reversed one of the x200's.
It'd be great if there was a simpler way of doing this. so, I'm all for the crop resize.
It'd be great if there was a simpler way of doing this. so, I'm all for the crop resize.