Convert JPEG to BMP

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
oorexxpert
Posts: 5
Joined: 2016-01-13T13:08:13-07:00
Authentication code: 1151

Convert JPEG to BMP

Post by oorexxpert » 2016-01-13T13:24:39-07:00

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.

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

Re: Convert JPEG to BMP

Post by snibgo » 2016-01-13T13:32:17-07:00

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 "!".
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 25530
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert JPEG to BMP

Post by fmw42 » 2016-01-13T14:08:37-07:00

If you want to resize, then use

Code: Select all

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

User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Convert JPEG to BMP

Post by glennrp » 2016-01-13T14:17:11-07:00

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.

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

Re: Convert JPEG to BMP

Post by snibgo » 2016-01-13T14:22:22-07:00

Well spotted, Glenn. "Invalid Parameter" is an error message from the Microsoft "convert" program, not ImageMagick.
snibgo's IM pages: im.snibgo.com

oorexxpert
Posts: 5
Joined: 2016-01-13T13:08:13-07:00
Authentication code: 1151

Re: Convert JPEG to BMP

Post by oorexxpert » 2016-01-13T15:24:27-07:00

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

oorexxpert
Posts: 5
Joined: 2016-01-13T13:08:13-07:00
Authentication code: 1151

Re: Convert JPEG to BMP

Post by oorexxpert » 2016-01-13T15:26:50-07:00

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.

User avatar
fmw42
Posts: 25530
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert JPEG to BMP

Post by fmw42 » 2016-01-13T15:30:19-07:00

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?

oorexxpert
Posts: 5
Joined: 2016-01-13T13:08:13-07:00
Authentication code: 1151

Re: Convert JPEG to BMP

Post by oorexxpert » 2016-01-13T15:51:17-07:00

I tried it again with the command:

CONVERT tt0303714.JPG -resize 300x450 tt0303714.BMP

and received error:

Invalid Parameter - -resize

User avatar
fmw42
Posts: 25530
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert JPEG to BMP

Post by fmw42 » 2016-01-13T15:59:39-07:00

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.

User avatar
GeeMack
Posts: 717
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Convert JPEG to BMP

Post by GeeMack » 2016-01-13T21:44:46-07:00

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.

oorexxpert
Posts: 5
Joined: 2016-01-13T13:08:13-07:00
Authentication code: 1151

Re: Convert JPEG to BMP

Post by oorexxpert » 2016-01-21T11:03:36-07:00

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

User avatar
fmw42
Posts: 25530
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert JPEG to BMP

Post by fmw42 » 2016-01-21T11:07:15-07:00

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

Post Reply