ImageMagick problem with identify of DNG Image without extension - imagemagick

I'm trying to get format, filesize, width and height from an DNG Image. With a .DNG extension identify L1004220.dng returns the correct data: L1004220.DNG DNG 5216x3472 5216x3472+0+0 16-bit sRGB 17.4867MiB 0.000u 0:00.003.
The problem now is, I've made a md5 hash from the filename and stored it somewhere else, lets call the file 17a14024496c3bea3b81362510962785. Now if I run the same command with the md5 filename it will give me another result: 17a14024496c3bea3b81362510962785 TIFF 320x216 320x216+0+0 8-bit sRGB 17.4867MiB 0.010u 0:00.008
It somehow identified it as a TIFF instead of a DNG image.
But when I give 17a14024496c3bea3b81362510962785 a .dng extension, it again works.
I only have this problem with DNG images. Other formats work as expected.
I run it on Linux. I installed the libraw-dev package which ImageMagick uses as a delegate for DNG Images. I use a self compiled ImageMagick 7.
For testing I used a sample image (Original DNG (18MB)) from here https://www.kenrockwell.com/leica/m9/sample-photos-3.htm
Anyone encountered this problem before? Am I using the wrong package as delegate?

I was able to solve the problem by adding dng: before the filename like:
identify dng:17a14024496c3bea3b81362510962785
result:
dng:17a14024496c3bea3b81362510962785=>17a14024496c3bea3b81362510962785 DNG 5216x3472 5216x3472+0+0 16-bit sRGB 17.4867MiB 0.010u 0:00.003

Related

Image magic TIFF Warning

Am trying to run a simple .eps to .png conversion using image magic convert.exe,
IF EXIST test.eps convert.exe test.eps test.png
I see the error :
convert.exe: Invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectoryCheckOrder' # warning/tiff.c/TIFFWarnings/960.
I do not have TIFF image inside the folder nor am trying to convert TIFF image. Why am I seeing this error?

What type of metadata -strip removes?

-strip actually removes some metadata in case of ImageMagick. What type of metadata actually it removes?
In ImageMagick, it has been noticed that
strip the image of any profiles, comments or these PNG chunks:
bKGD,cHRM,EXIF,gAMA,iCCP,iTXt,sRGB,tEXt,zCCP,zTXt,date.
What are these chunks?
What about other format images?
They are chunks that are not necessary for displaying an image.
These are described in the PNG specification:
bKGD,cHRM,gAMA,iCCP,iTXt,sRGB,tEXt,zTXt.
zCCP is an ICCP profile stored in an iTXt or zTXt chunk.
date: Image creation date and modification date that
would otherwise be autimatically inserted by ImageMagick
EXIF: camera data usually coming from a JPEG or RAW image.

GraphicsMagick Error: gm convert: profile matches sRGB but writing iCCP instead

When I try to convert a jpg image to a png, I get the following errors message occasionally. What does it mean?
> gm convert xxx.jpg png32:xxx.png
gm convert: profile matches sRGB but writing iCCP instead (xxx.png).
It's not an error but a warning.
Your input file (xxx.jpg) contains an ICC profile that represents sRGB. The png writer notices that, and issues a warning (because writing a 13-byte sRGB chunk is more efficient than writing a multi-kilobyte iCCP chunk). These days, even the sRGB chunk is wasteful if your image is intended to be displayed by a browser, because browsers assume that pixels are in the sRGB colorspace anyhow, when there is no color information present in the PNG file.

Read with 8 bits in Rmagick doesn't work correctly?

I have Rmagick using an ImageMagick compiled for 16bit.
However, I am able to read a file by doing this:
file = Magick::Image.read(my_file){self.depth = 8}.first
And when doing an inspect of that file, I see that it is
PNG 1400x768 1400x768+0+0 DirectClass 8-bit 333kb
However, when accessing any of the pixels, the values are bigger than 0-255.
Why is that? What am I missing?
I access it like this:
red = image.pixel_color(x,y).red
I don't understand why the value would be from 0 to 2^16, when I specifically have opened the image with 8 bits of depth.
The version of ImageMagick you are using is Q16 (16-bit). This means that ImageMagick will always use an unsigned short internally to store a channel of a pixel. You could switch to the Q8 version of ImageMagick if all your images are 8-bit. More info about the architecture of ImageMagick can be found here: http://www.imagemagick.org/script/architecture.php

Generating a 16-bits per channel PNG file procedurally

Is there any way to generate a 16-bits per channel(RGBA) PNG file using D3DX11SaveTextureToFile?
Or any version of DirectX, any image library(C++), any image format
I tried to use the sample code here:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb205131(v=vs.85).aspx
and modified the function names to D3D11 version.
The program works perfectly when I set the desc.Format to DXGI_FORMAT_R8G8B8A8_UNORM .
But the D3DX11SaveTextureToFile returns E_FAIL when I changed the desc.Format to DXGI_FORMAT_R16G16B16A16_UNORM .
I've tried to use DevIL (developer's image library) but it doesn't support 16-bits per channel png file.
The only format which can save all texture-formats is D3DX11_IFF_DDS. It seems that D3DX11SaveTextureToFile can't save 16Bit pngs. One possibility is to extract the imagedata of your texture and save it manually with one of the possibilities (e.g. OpenCV or libpng) discussed here: Writing 16 bit uncompressed image using OpenCV.

Resources