How to convert 16 bit PNG to 16 bit TIF?

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, helmut, xnview

Micha
Posts: 134
Joined: Thu Feb 08, 2007 12:51 pm

How to convert 16 bit PNG to 16 bit TIF?

Post by Micha »

Hi,

if I convert a 16 bit PNG to a TIFF than the 16 bit color depth is lost. Is it a bug or do I need to set the right parameter only?

-Micha
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by xnview »

Image data is 8bits per component internally, only NConvert can convert 16bits to 16bits
Pierre.
Micha
Posts: 134
Joined: Thu Feb 08, 2007 12:51 pm

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by Micha »

Sounds good. I tried it but ... "WARNING: the picture will be converted to RGB with 8bits per component". Did I have overseen an option?
cday
XnThusiast
Posts: 3976
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by cday »

Micha wrote: Fri Nov 29, 2019 12:01 pm Sounds good. I tried it but ... "WARNING: the picture will be converted to RGB with 8bits per component". Did I have overseen an option?
Pierre is referring to NConvert the command line utility, if that could be a source of confusion?
Micha
Posts: 134
Joined: Thu Feb 08, 2007 12:51 pm

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by Micha »

Thank you for the hint. I tested it at NConvert with UI. So, I will look for how to use the command line tool.
marsie321
Posts: 10
Joined: Tue Jan 26, 2021 1:11 pm

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by marsie321 »

I have the same problem, I really like XnView MP but my sensor-data (infrared) is 16bit. I need to extract the pages and save as 16bit tiff.
Do you have plans to integrated saving as 16bit in XnView MP?

And how do I tell nconvert that it should save as 16Bit gray tiff - here is what I have done so far:

nconvert -out tiff -xall -keepfiledate -keepcspace ./DJI_0018.TIFF

Thank you.
Martin
marsie321
Posts: 10
Joined: Tue Jan 26, 2021 1:11 pm

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by marsie321 »

Maybe the problem is that the file is not recognized correctly. It is a multi-page 16-bit grey tiff.

identify ./DJI_0018.TIFF
./DJI_0018.TIFF[0] TIFF 640x512 640x512+0+0 16-bit Grayscale Gray 2.16959GiB 2.830u 0:10.921
./DJI_0018.TIFF[1] TIFF 640x512 640x512+0+0 16-bit Grayscale Gray 2.850u 0:10.928

nconvert -v -i -ctype grey -in tiff ./DJI_0018.TIFF
** NCONVERT v7.39 (c) 1991-2019 Pierre-E Gougelet (Feb 25 2020/13:19:45) **
Version for Linux x86 (X11) (All rights reserved)
A TIFF (RGB) was recognized : ./DJI_0018.TIFF
Width:640 Height:512 with 256 colors
Nplanes : 1 Bitscount : 8
Bytes Per Plane : 640
xdpi : 0 ydpi : 0
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by xnview »

you need to use -org_depth
Pierre.
marsie321
Posts: 10
Joined: Tue Jan 26, 2021 1:11 pm

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by marsie321 »

Hi Pierre,

also with -org_depth it does not work, can I force or overwrite the channels depth to set gray-16Bit for tiff?

nconvert -v -i -ctype grey -org_depth -in tiff ./DJI_0018.TIFF
** NCONVERT v7.39 (c) 1991-2019 Pierre-E Gougelet (Feb 25 2020/13:19:45) **
Version for Linux x86 (X11) (All rights reserved)
** This is freeware software (for non-commercial use)

A TIFF (RGB) was recognized : ./DJI_0018.TIFF
Width:640 Height:512 with 256 colors
Nplanes : 1 Bitscount : 8
Bytes Per Plane : 640
xdpi : 0 ydpi : 0
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by xnview »

the original depth is 8bits?
Pierre.
marsie321
Posts: 10
Joined: Tue Jan 26, 2021 1:11 pm

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by marsie321 »

Hi Pierre,

the original data is 16 bit, but NCovert is recognizing it as 8 bit. Otherwise nconvert is doing everything great, splitting the multi-page tiff and rewrite the exif/meta.

magick identify ./DJI_0018.TIFF
./DJI_0018.TIFF[0] TIFF 640x512 640x512+0+0 16-bit Grayscale Gray 2.16959GiB 2.830u 0:10.921
./DJI_0018.TIFF[1] TIFF 640x512 640x512+0+0 16-bit Grayscale Gray 2.850u 0:10.928

mediainfo ./DJI_0018.TIFF
General
Complete name : ./DJI_0018.TIFF
Format : TIFF
File size : 2.17 GiB
Writing application : DJI V06.02.20
Writing library : XT2

Image
Format : Raw
Format settings : Little
Width : 640 pixels
Height : 512 pixels
Color space : Y
Bit depth : 16 bits
Compression mode : Lossless
Density : 1 dpcm


nconvert -i -v -org_depth ./DJI_0018.TIFF
** NCONVERT v7.39 (c) 1991-2019 Pierre-E Gougelet (Feb 25 2020/13:19:45) **
Version for Linux x86 (X11) (All rights reserved)
** This is freeware software (for non-commercial use)

A TIFF (RGB) was recognized : ./DJI_0018.TIFF
Width:640 Height:512 with 256 colors
Nplanes : 1 Bitscount : 8
Bytes Per Plane : 640
xdpi : 0 ydpi : 0

nconvert -i -v ./DJI_0018.TIFF
** NCONVERT v7.39 (c) 1991-2019 Pierre-E Gougelet (Feb 25 2020/13:19:45) **
Version for Linux x86 (X11) (All rights reserved)
** This is freeware software (for non-commercial use)

A TIFF (RGB) was recognized : ./DJI_0018.TIFF
Width:640 Height:512 with 256 colors
Nplanes : 1 Bitscount : 8
Bytes Per Plane : 640
xdpi : 0 ydpi : 0
marsie321
Posts: 10
Joined: Tue Jan 26, 2021 1:11 pm

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by marsie321 »

Hi Pierre,

I uploaded a single page (DJI_0018_55.tif).

mediainfo DJI_0018_55.tif
General
Complete name : DJI_0018_55.tif
Format : TIFF
File size : 642 KiB

Image
Format : Raw
Format settings : Little
Width : 640 pixels
Height : 512 pixels
Color space : Y
Bit depth : 16 bits
Compression mode : Lossless
Density : 1 dpcm


nconvert -v -i DJI_0018_55.tif
** NCONVERT v7.39 (c) 1991-2019 Pierre-E Gougelet (Feb 25 2020/13:19:45) **
Version for Linux x86 (X11) (All rights reserved)
** This is freeware software (for non-commercial use)

A TIFF (RGB) was recognized : DJI_0018_55.tif
Width:640 Height:512 with 256 colors
Nplanes : 1 Bitscount : 8
Bytes Per Plane : 640
xdpi : 0 ydpi : 0
Conversion of DJI_0018_55.tif into DJI_0018_55_1.tif OK
Attachments
DJI_0018_55.tif
(641.63 KiB) Downloaded 24 times
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by xnview »

ok, i don't know why and when, but the 16bits support has disappear from NConvert, i'll fix it
Pierre.
marsie321
Posts: 10
Joined: Tue Jan 26, 2021 1:11 pm

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by marsie321 »

Thank you,

If you like I could to test the 16bit support even in beta-version, and give you feedback. I also have some ppm in 16bit, that I can test.
marsie321
Posts: 10
Joined: Tue Jan 26, 2021 1:11 pm

Re: How to convert 16 bit PNG to 16 bit TIF?

Post by marsie321 »

Hi Pierre,

do you have any roadmap in mind regarding the fix of the 16bit.

Thank you,
Post Reply