How to convert an image and also generate thumbnail from it

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
yogiyang
Posts: 5
Joined: 2013-08-13T05:21:01-07:00
Authentication code: 6789

How to convert an image and also generate thumbnail from it

Post by yogiyang »

I want to convert any supported format image to JPG and also generate a thumbnail of max size 200x200 pixels.

Currently I am giving two commands for this:

Code: Select all

convert "12 x 36\010 copy.jpg" c:\up_temp\001.jpg
and

Code: Select all

"convert.exe" -define jpeg:size=500x180 "C:\up_temp\001.jpg"  -auto-orient -thumbnail 200x200   -unsharp 0x.5  "c:\up_temp\tn\00001.jpg"
The first command is generating JPG which are bigger than the original file so what can I do to compress the generated file without any quality loss?

How can I convert above two commands to one single command so that both things are completed in one single command?

TIA

Yogi Yang
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to convert an image and also generate thumbnail from

Post by snibgo »

You don't need the first command. Just put the original file name in the second command.

Code: Select all

"convert.exe" -define jpeg:size=500x180 "12 x 36\010 copy.jpg"  -auto-orient -thumbnail 200x200   -unsharp 0x.5  "c:\up_temp\tn\00001.jpg"
snibgo's IM pages: im.snibgo.com
yogiyang
Posts: 5
Joined: 2013-08-13T05:21:01-07:00
Authentication code: 6789

Re: How to convert an image and also generate thumbnail from

Post by yogiyang »

snibgo wrote:You don't need the first command. Just put the original file name in the second command.

Code: Select all

"convert.exe" -define jpeg:size=500x180 "12 x 36\010 copy.jpg"  -auto-orient -thumbnail 200x200   -unsharp 0x.5  "c:\up_temp\tn\00001.jpg"
Thanks for your assistant.

This only creates the thumbnail. The the file created when using my first command is not getting generated here.

TIA

Yogi Yang
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to convert an image and also generate thumbnail from

Post by snibgo »

How about:

Code: Select all

copy "12 x 36\010 copy.jpg" c:\up_temp\001.jpg
snibgo's IM pages: im.snibgo.com
Post Reply