This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Byte order in exported 16bit PSDs (Windows)

Tags: None
(comma "," separated)
n-i-c-l-a-s
Registered Member
Posts
8
Karma
0
Hi everyone,

I am new to Krita, so I want to start with saying 'Hello!' to everyone here on the forum. I tested Krita the first time a year ago (I think) and while I really liked the Brush engine, it was kind of buggy for me at the time, so I didnt use it that much (to be fair, Krita was in beta stadium at the time, so bugs were to be expected). I then got distracted with other stuff and rediscovered Krita when I was looking for a 16-bit capable image editor.
After playing around with it for a while, I have to say it really is a wonderful tool now, the developers really did an amazing job! I am impressed :)

Unfortunately I ran into a small (very specific issue) when exporting 16bit grayscale images as PSD files: It seems like Krita saves them using "little endian"-byte order (on a windows machine). While this technically makes sense, as Windows machines generally use LE byte order, I think Adobe's PSD file format actually uses "big endian" byte order independently of the system. https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/ (I have no idea why. Maybe because Macs were still PowerPCs at the time when Adobe specified the file format?)

For example, when I save a grayscale 16bit PSD file with a single layer filled with grayvalue 32768, the pixels are saved as "0x0080" (I looked at the file in a hex editor), although it should be "0x8000" in BE byte order. While most applications still seem to be able to load the file correctly I ran into problems when trying to import these PSDs into zBrush. The imported images look like noise-patches (which in my experience tend to be problems with the byte order for 16bit images)

I am not 100% sure if this is a problem with Krita or a problem with zBrush, but since zBrush does not have any problems reading PSDs exported from other applications, I guess this is an issue of Krita's PSD export. Would it be possible to fix this issue or to provide an option, which lets us choose the byte order during PSD export? (No hurry though, as there is workaround: save the 16bit file as TIFF and then convert it to PSD using other applications)

I am sorry if my analysis is wrong, I always get confused when thinking about little and big endians :)
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
I can't test with zbrush myself -- the golden rule is always, if photoshop can read it, it's probably saved okay. Rght now I cannot check either, since I'm on vacation/at KDE's annual conference, but it's worth reporting it as a bug. When I get home, I'll spend some days digging through all bug reports!
n-i-c-l-a-s
Registered Member
Posts
8
Karma
0
Thanks very much for your quick reply! Pixologic made a zBrush-trial available a few weeks ago, so you could test it with zBrush, if you have the time (after your vacation, of course). In zBrush you can import 16 bit images (as alphas ) under Alpha->Import. If you load a Krita generated 16bit grayscale PSD-image, you should see the issue directly in the alpha-preview.

Unfortunately, I can not test it with Photoshop myself, because I do not own/use it. I tested it with Photoshop Elements, though, and while Elements does not support 16bit images, the conversion to 8 bit looked just fine.

I did not want to write a bug report, becuase I did not know, if it is actually a bug or rather a "missing" feature. But I checked a few more Krita-exported PSDs and I am pretty sure now, that Krita saves the image data with Little Endian byte order. And since adobe's official documentation of the PSD file format states that "All data is stored in big endian byte order." this might qualify as a bug. On the other hand, most applications other than zBrush can read both formats just fine...

Thanks again for your help!


ps. Be careful if you choose to try zBrush. As a Krita-Developer you probably have a soft spot for great brush engines and you might feel the urge to give Pixologic a lot of money after trying zBrush (if you have any interest at all in 3d sculpting or 2.5d painting )
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
Heh... I don't want to do digital sculpting! It's one of the few things in my life that are still firmly analog! But do make a bug report, this needs looking into.
n-i-c-l-a-s
Registered Member
Posts
8
Karma
0
All I am saying is "Be careful" ;)

I'll write a bug report tomorrow, Enjoy your holiday/the conference!
n-i-c-l-a-s
Registered Member
Posts
8
Karma
0
I just submitted the bug report. Thanks for looking into it!
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
Thanks!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]