Support for PAM P7 4 byte TUPLTYPE GRAYSCALE_ALPHA

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, xnview

Post Reply
brianp
Posts: 1
Joined: Sun Oct 06, 2019 3:21 pm

Support for PAM P7 4 byte TUPLTYPE GRAYSCALE_ALPHA

Post by brianp » Sun Oct 06, 2019 4:44 pm

I am running 64 bit Linux and need a viewer for 4 byte per pixel grayscale with Alpha images. 64k grayscale with 64k alpha.

LodePNG works, but takes forever. By "works" I mean that it creates files which display correctly in Photoshop CS6, GIMP, Gwenview and ShowFOTO.

I hand rolled a PNG creator from scratch based on the PNG spec and it is much faster but still calculates the CRC (not necessary) and runs through zlib which adds 11kB and is unnecessary.

I found the PAM, P7 format which seems to be ideal and which is supposed to be supported by XnView. It has a very simple header followed by uint16 pairs for the gray value and the opacity.

The file has the exact size and the above header: Size = 4 bytes/quantum * 7360 xres * 4912 yres + 79 header_bytes =
lsr -s *.pam -> pf-269367.blu.alp.lp.pam 144609359

head -n7 pf-269367.blu.alp.lp.pam
P7
WIDTH 7360
HEIGHT 4912
DEPTH 4
MAXVAL 65535
TUPLTYPE GRAYSCALE_ALPHA
ENDHDR

When I open it in XnView MP Linux Version 0.93.1 64bits (Mar 7 2019) Libformat version 7.25, It pops up Firefox and asks me to save the file.

Png indexed files show in the XnView GUI.

The PAM file extension is not shown in the about -> formats, nor is it listed in portable grayscale* or image*

Is it possible to add grayscale-alpha support with 16 bits of each to XnView?

When I open the PNG files with 16 bit grayscale and 16 bit Alpha in XnView, it asks me to confirm "convert to RGB with 8 bits". It appears to discard the opacity entirely and show the 16 bit image data noticeably downgraded to 8 bit quanta.

Is 8 bits/channel, RGB/24 the maximum quantum depth XnView will show?

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

Re: Support for PAM P7 4 byte TUPLTYPE GRAYSCALE_ALPHA

Post by xnview » Fri Nov 22, 2019 11:08 am

could you send me some sample files?
Pierre.

Post Reply