Pono
Pono

Reputation: 11806

ImageMagick doesn't convert the file type while resizing

This is an extension problem. Say I have a JPEG image with a .png extension. Let's call this file image.png (keep in mind it's still internally a real JPEG). When I resize it (and overwrite) with:

convert -resize 100x100 image.png image.png

what happens is ImageMagick thinks I want to also convert the image to the real PNG format (since it's a JPEG but output file has a .png extension).

Is there any way to resize an image with ImageMagick without converting it to a format specified by the extension of output file? I just want this particular image to stay as a JPEG and without converting it to a real .png (image/png).

Upvotes: 1

Views: 246

Answers (2)

emcconville
emcconville

Reputation: 24439

Just redirect it to stdout

convert -resize 100x100 image.png -format JPEG - > image.png

Upvotes: 0

Doc Brown
Doc Brown

Reputation: 20054

Try

  convert -resize 100x100 image.png jpg:image.png

Upvotes: 2

Related Questions