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?".
simon
Post
by simon » 2008-10-01T09:41:54-07:00
Hi,
I have a script that uses convert to process some png files into raw files.
This used to work
Code: Select all
convert foo.png -depth 16 r:bar.raw
but now when I run it convert doesn't generate a file.
if I do this
it makes a file but in png format not raw - renaming the output to bar.png allows me to open it.
if I do this
Code: Select all
convert foo.png -depth 16 rgb:bar.raw
I correctly get a raw file but it is rgb not grayscale.
So what is going on here, and how do you generate 16 bit grayscale raw files using convert these days?
magick
Site Admin
Posts: 11064 Joined: 2003-05-31T11:32:55-07:00
Post
by magick » 2008-10-01T09:56:36-07:00
We're using ImageMagick 6.4.4-1, the latest release, these commands work as expected (creates 16-bit gray image of the red channel):
convert logo: -interlace none -depth 16 r:bar.raw
display -size 640x480 -interlace none -depth 16 gray:bar.raw
Do these commands work for you?
simon
Post
by simon » 2008-10-01T10:02:32-07:00
I'm using the same version on windows and when I run that command no file is generated.
No errors but no output file.
Changing to rgb:bar.raw generates a file, but not the format I want.
When I run my script I get this error
convert: unable to open image `r:1.raw': No such file or directory
Again changing to rgb: means that files are generated but in the wrong format.
magick
Site Admin
Posts: 11064 Joined: 2003-05-31T11:32:55-07:00
Post
by magick » 2008-10-01T10:07:27-07:00
We tried these commands under Windows, ImageMagick 6.4.4-1, and they worked as expected:
convert logo: -interlace none -depth 16 r:bar.raw
convert -size 640x480 -interlace none -depth 16 gray:bar.raw bar.png
We're not sure why its failing for you.
simon
Post
by simon » 2008-10-01T10:09:49-07:00
if I do this
convert foo.png -depth 16 gray:bar.raw
I get a grayscale 16 bit raw file but when I open it the image is scrambled.
Damn this is annoying.
simon
Post
by simon » 2008-10-01T10:18:50-07:00
Is your input file a 16 bit grayscale png?
simon
Post
by simon » 2008-10-01T10:23:59-07:00
Ah! this does work
Code: Select all
convert foo.png -depth 16 gray:bar.raw
but I have to open with IBM byte order.
magick
Site Admin
Posts: 11064 Joined: 2003-05-31T11:32:55-07:00
Post
by magick » 2008-10-01T10:27:38-07:00
You can specify the byte order with the -endian option.
simon
Post
by simon » 2008-10-01T10:48:45-07:00
cheers that should do it
simon
Post
by simon » 2008-10-02T09:33:39-07:00
I found the problem.
I had a drive mapped to R: so instead of it using the raw format it wrote the file to the R: drive, something to look at perhaps....
magick
Site Admin
Posts: 11064 Joined: 2003-05-31T11:32:55-07:00
Post
by magick » 2008-10-02T10:06:16-07:00
You can work around the conflict with filenames like r:image.r or raw:image.r. See if that works.
Users browsing this forum: Ahrefs [Bot] , Amazon [Bot] , Bing [Bot] , DuckDuckGo [Bot] , Semrush [Bot] and 8 guests