Converting 15001x15001 bitmap to 15001x15001 jpg

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
beans46
Posts: 3
Joined: 2020-01-12T14:52:41-07:00
Authentication code: 1152

Converting 15001x15001 bitmap to 15001x15001 jpg

Post by beans46 »

Hi, as the title says, I'm trying to convert a 15001x15001 monochrome bitmap of a maze generated with Daedalus 3.3 into a jpg. When I do

Code: Select all

magick convert perfect15k.bmp perfect15k.jpg
but the result is a massive 30001x30001 jpg that I can't open with anything.
With what command would I turn the bitmap into a monochrome 15001x15001 jpg with no compression (as each passage is 1 pixel big and any compression would ruin it)?

I know this is possible because I can do it something like IrfanViewer, but that is obviously not the best solution for batch conversion.

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

Re: Converting 15001x15001 bitmap to 15001x15001 jpg

Post by fmw42 »

JPG is always compressed even at 100% quality. You are converting a monochrome image into a 24-bit compressed image. Why do you want a jpg? Seems that you gain in image size by doing that. Also note that in IM 7, use magick, not magick convert. The latter may give IM 6 behavior where a grayscale image will will have 4 channels in memory and so you may be running out of RAM.

beans46
Posts: 3
Joined: 2020-01-12T14:52:41-07:00
Authentication code: 1152

Re: Converting 15001x15001 bitmap to 15001x15001 jpg

Post by beans46 »

fmw42 wrote:
2020-01-12T15:50:47-07:00
JPG is always compressed even at 100% quality. You are converting a monochrome image into a 24-bit compressed image. Why do you want a jpg? Seems that you gain in image size by doing that. Also note that in IM 7, use magick, not magick convert. The latter may give IM 6 behavior where a grayscale image will will have 4 channels in memory and so you may be running out of RAM.
Thanks for the reply!
I don't mind the extra size because the editor I'm feeding it into can't open bitmaps, but it also can't open 30001x30001 jpgs. How would I convert 15001x15001 bmp to 15001x15001 jpg, because currently it converts to 30001x30001 jpg.
I know, it's a stupid use-case :lol:

I have tried

Code: Select all

magick perfect15k.jpg -resize 15001x15001 perfect15k_r.jpg
but it results in the picture looking like random static (I guess as a result of 15001^2 being 25% of 30001^2).

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

Re: Converting 15001x15001 bitmap to 15001x15001 jpg

Post by fmw42 »

I do not understand how a 15001x15001 bmp can convert to twice the dimensions. You must be doing something wrong or have some strange data format. I also do not understand your command. You are starting with a jpg not a bmp? Why do you want to resize it, since the input bmp should already be 15001x15001. Please clarify. How much RAM do you have? Do you have enough space in your tmp or temp directory? What is your platform?

Why do you have to convert to JPG? Why not monochrome TIFF for example or PNG?

beans46
Posts: 3
Joined: 2020-01-12T14:52:41-07:00
Authentication code: 1152

Re: Converting 15001x15001 bitmap to 15001x15001 jpg

Post by beans46 »

fmw42 wrote:
2020-01-12T17:10:59-07:00
I do not understand how a 15001x15001 bmp can convert to twice the dimensions. You must be doing something wrong or have some strange data format. I also do not understand your command. You are starting with a jpg not a bmp? Why do you want to resize it, since the input bmp should already be 15001x15001. Please clarify. How much RAM do you have? Do you have enough space in your tmp or temp directory? What is your platform?

Why do you have to convert to JPG? Why not monochrome TIFF for example or PNG?
I apologize profusely, seems the maze size settings in daedalus isn't what I thought it was, and I was actually generating a 30001x30001 bitmap from the start.
Sorry again!

Post Reply