What type of metadata -strip removes? - imagemagick

-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.

Related

ImageMagick problem with identify of DNG Image without extension

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

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?

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.

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.

File Format Conversion to TIFF. Some issues?

I'm having a proprietary image format SNG( a proprietary format) which is having a countinous array of Image data along with Image meta information in seperate HDR file.
Now I need to convert this SNG format to a Standard TIFF 6.0 Format. So I studied the TIFF format i.e. about its Header, Image File Directories( IFD's) and Stripped Image Data.
Now I have few concerns about this conversion. Please assist me.
SNG Continous Data vs TIFF Stripped Data: Should I convert SNG Data to TIFF as a continous data in one Strip( data load/edit time problem?) OR make logical StripOffsets of the SNG Image data.
SNG Data Header uses only necessary Meta Information, thus while converting the SNG to TIFF, some information can’t be retrieved such as NewSubFileType, Software Tag etc.
So this raises a concern that after conversion whether any missing directory information such as NewSubFileType, Software Tag etc is necessary and sufficient condition for TIFF File.
Encoding of each pixel component of RGB Sample in SNG data:
Here each SNG Image Data Strip per Pixel component is encoded as:
Out^[i] := round( LineBuffer^[i * 3] * **0.072169** + LineBuffer^[i * 3 + 1] * **0.715160** + LineBuffer^[i * 3+ 2]* **0.212671**);
Only way I deduce from it is that each Pixel is represented with 3 RGB component and some coefficient is multiplied with each component to make the SNG Viewer work RGB color information of SNG Image Data. (Developer who earlier work on this left, now i am following the trace :))
Thus while converting this to TIFF, the decoding the same needs to be done. This raises a concern that the how RBG information in TIFF is produced, or better do we need this information?.
Please assist...
Are you able to load this into a standard windows bitmap handle? If so, there are probably a bunch of free and commercial libraries for saving it as TIFF.
The standard for TIFF is libtiff -- it's a C library. Here's a version for Delphi made by an expert in the TIFF format:
http://www.awaresystems.be/imaging/tiff/delphi.html
There seems to be a lot of choices.
I think the approach of
Loading your format into an in-memory standard bitmap (which you need to do to show it, right?)
Using a pre-existing TIFF encoding library to save as TIFF
Will be a lot easier than trying to do a direct format-to-format conversion. The only reasons I wouldn't do it this way are:
The bitmap is too big to keep in memory
The original format is lossy and I will lose more quality in the re-encoding -- but you'd have to be saving in a standard lossy format (JPEG) to save quality.
Disclaimer: I work for Atalasoft.
We make .NET imaging codecs (including TIFF) -- that are a lot easier to use than LibTiff -- you can call them in Delphi through COM. We can convert standard windows bitmaps to TIFF or PDF (or other formats) with a couple of lines of code.
One approach, if you have a Windows application which handles and can print this format, would be to let it do the work for you, and call it to print the file to one of the many available 'printer drivers' which support direct output to TIFF.

Resources