Page 1 of 1

Convert JPEG to BMP

Posted: 2016-01-13T13:24:39-07:00
by oorexxpert
Just installed Imagemagick. I am trying to convert JPEG images from JPG extensions to BMP extensions. I have tried just a plain convert. But that didn't display in a ooREXX dialog I have. I thought I needed to resize the image but I can't get CONVERT to accept the parameter. I have tried it many ways but can't figure it out. For example, I tried:

CONVERT -size 300x450! tt0303714.JPG tt0303714.BMP

Which gave me the error:

Invalid Parameter - 300x450!

Must me something simple I am missing but I can't find it. Any help would be appreciated.

Re: Convert JPEG to BMP

Posted: 2016-01-13T13:32:17-07:00
by snibgo
A jpg file contains metadata, including its size, so the "-size" option is redundant.

The size option takes two integers with "x" between them. No "!".

Re: Convert JPEG to BMP

Posted: 2016-01-13T14:08:37-07:00
by fmw42
If you want to resize, then use

Code: Select all

convert tt0303714.JPG -resize WxH tt0303714.BMP
-size is for creating new files.

Re: Convert JPEG to BMP

Posted: 2016-01-13T14:17:11-07:00
by glennrp
First make sure you're really running ImageMagick's "convert" and if so, what version:
Type

Code: Select all

convert -version
or

Code: Select all

convert | head -2
to find out.

Re: Convert JPEG to BMP

Posted: 2016-01-13T14:22:22-07:00
by snibgo
Well spotted, Glenn. "Invalid Parameter" is an error message from the Microsoft "convert" program, not ImageMagick.

Re: Convert JPEG to BMP

Posted: 2016-01-13T15:24:27-07:00
by oorexxpert
The response to:

CONVERT - verison

is:

Version: ImageMagick 6.9.2-0 Q16 x64 2015-08-15 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

Re: Convert JPEG to BMP

Posted: 2016-01-13T15:26:50-07:00
by oorexxpert
I also tried it with the -resize parameter. I have a button in the dialog that I want to fill to the outside edge. That is why I tried -size and -resize.

Re: Convert JPEG to BMP

Posted: 2016-01-13T15:30:19-07:00
by fmw42
Have you really an x between WxH? Check or retype it. What is the command again and what is the error? Is -resize WxH after the input image?

Re: Convert JPEG to BMP

Posted: 2016-01-13T15:51:17-07:00
by oorexxpert
I tried it again with the command:

CONVERT tt0303714.JPG -resize 300x450 tt0303714.BMP

and received error:

Invalid Parameter - -resize

Re: Convert JPEG to BMP

Posted: 2016-01-13T15:59:39-07:00
by fmw42
I am surprised the following works. The hyphen should be next to -version and it is spelled wrong.

Code: Select all

CONVERT - verison
Try

Code: Select all

convert -version
I would agree with the others that somehow you may be running the Windows convert and not the IM convert.

Re: Convert JPEG to BMP

Posted: 2016-01-13T21:44:46-07:00
by GeeMack
oorexxpert wrote:Invalid Parameter - -resize
That would be an error message from the Windows convert command. See if you have the IM convert command somewhere in your path by typing this at the command line...

Code: Select all

where convert
If none of the output lines show the ImageMagick convert command, that means it's not in your path. If the IM convert command is below the Windows convert command, that means you need to modify your path so Windows looks in the IM directory before it looks in the Windows system directory.

Re: Convert JPEG to BMP

Posted: 2016-01-21T11:03:36-07:00
by oorexxpert
Well, I'm back. I had to leave for a while, sorry. I have tried a simple example where no resizing was involved. I issued the following:

C:\Users\John\My Documents\IMDB\POSTERS>"c:\program files\imagemagick-6.9.2-q16\convert.exe" tt0024124.jpg tt0024124.bmp

C:\Users\John\My Documents\IMDB\POSTERS>

It seemed to work. However, when I tried to display in in an ooREXX dialog with an ADDBITMAPBUTTON statement, nothing appeared. However, when I edited the JPG file with PAINT and saved it, unaltered, as a BMP file, it displayed correctly. There is obviously something that CONVERT does differently PAINT. I could use PAINT but I have around 1500 images to convert and using a program rather than PAINT would be a lot quicker.

John

Re: Convert JPEG to BMP

Posted: 2016-01-21T11:07:15-07:00
by fmw42
There are several forms of BMP. Your other program may want one of the older forms. So try BMP3:tt0024124.bmp or BMP2:tt0024124.bmp for the output image and see if that works. For mass conversion, see mogrify http://www.imagemagick.org/Usage/basics/#mogrify, though I am not sure without testing, how to specify the BMP3: or BMP2: in mogrify.

see
http://www.imagemagick.org/Usage/formats/#bmp