Help needed writing greyscale PSD files

F
Posted By
Fred
Apr 25, 2005
Views
428
Replies
11
Status
Closed
Hello

I’m not an experienced Photoshop user and I’m trying to write out some multi-layered psd files from a proprietary application. I’m using my own code and the Adobe PhotoShop file format description to do this.

The resultant file is mostly right but my user complains that the layers are partially locked and he has to duplicate them to unlock them. Looking at the file in PS, I notice that the layer names in the Layer palette are italicised suggesting that PS regards them as Background layers. It’s not at all clear to me what I’m missing or what I’m writing incorrectly. By experimenting, I find that if I change the transparency of the layer to less than 100% or the layer type from "normal" to anything else then the layer is no longer locked.

I wondered if someone who has some experience in successfully writing multilayered greyscale PSD files could advise me of possible errors/omissions I might be making.

Alternatively, can anyone tell me what precisely denotes a layer as Background in the PSD file? If I take a file with a single background layer then this layer is locked. If I double click the layer on the layer-palette and replace the background layer with a new layer then I still have a single layer but the new layer is no longer locked. What is the significant change in the file which says that this layer is no longer a background layer?

Many Thanks
Fred

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

B
bogus
Apr 25, 2005
Don’t know if this will help…

In Photoshop, when you use Layer>Flatten Image all the information on the layers is put onto the Background layer. There is no longer any transparency and you can not save the PSD file with Layers checked.

You may be writting code for a flattened file with layers. Something you can not do within Photoshop.

Fred wrote:

Hello

I’m not an experienced Photoshop user and I’m trying to write out some multi-layered psd files from a proprietary application. I’m using my own code and the Adobe PhotoShop file format description to do this.
The resultant file is mostly right but my user complains that the layers are partially locked and he has to duplicate them to unlock them. Looking at the file in PS, I notice that the layer names in the Layer palette are italicised suggesting that PS regards them as Background layers. It’s not at all clear to me what I’m missing or what I’m writing incorrectly. By experimenting, I find that if I change the transparency of the layer to less than 100% or the layer type from "normal" to anything else then the layer is no longer locked.

I wondered if someone who has some experience in successfully writing multilayered greyscale PSD files could advise me of possible errors/omissions I might be making.

Alternatively, can anyone tell me what precisely denotes a layer as Background in the PSD file? If I take a file with a single background layer then this layer is locked. If I double click the layer on the layer-palette and replace the background layer with a new layer then I still have a single layer but the new layer is no longer locked. What is the significant change in the file which says that this layer is no longer a background layer?
Many Thanks
Fred

F
Fred
Apr 25, 2005
"bogus" wrote in message
Don’t know if this will help…

In Photoshop, when you use Layer>Flatten Image all the information on the layers is put onto the Background layer. There is no longer any transparency and you can not save the PSD file with Layers checked.
You may be writting code for a flattened file with layers. Something you can not do within Photoshop.

Thanks, I hadn’t appreciated that flattening put everything into the "Background" layer.

I suspect that adding some transparency info for each layer is the key but it’s still not clear exactly where this goes in the file. For example, if you flatten a multilayered file, you can still replace the resultant locked background layer with a duplicate and end up with a single unlocked layer with no obvious transparency info.

Thanks again
Fred
J
jenelisepasceci
Apr 26, 2005
"Fred" wrote:

Hello

I’m not an experienced Photoshop user and I’m trying to write out some multi-layered psd files from a proprietary application. I’m using my own code and the Adobe PhotoShop file format description to do this.
The resultant file is mostly right but my user complains that the layers are partially locked and he has to duplicate them to unlock them. Looking at the file in PS, I notice that the layer names in the Layer palette are italicised suggesting that PS regards them as Background layers. It’s not at all clear to me what I’m missing or what I’m writing incorrectly. By experimenting, I find that if I change the transparency of the layer to less than 100% or the layer type from "normal" to anything else then the layer is no longer locked.

I wondered if someone who has some experience in successfully writing multilayered greyscale PSD files could advise me of possible errors/omissions I might be making.
I just made a tiny ps image (4×4 pixels) and saved it as is and after I converted the background to a layer.
When I checked the saved files with a hex editor I found that file content is different at and after address 0x1358. This is probably the offset, at which layer information is stored, because shortly behind this address the layer name is written into the file. I’d suggest you do the same and compare data in this area to the specs of the file format and to the content of the files your application produces. HTH,

Peter
F
Fred
Apr 26, 2005
"Peter Wollenberg" wrote in message

I just made a tiny ps image (4×4 pixels) and saved it as is and after I converted the background to a layer.
When I checked the saved files with a hex editor I found that file content is different at and after address 0x1358. This is probably the offset, at which layer information is stored, because shortly behind this address the layer name is written into the file. I’d suggest you do the same and compare data in this area to the specs of the file format and to the content of the files your application produces. HTH,

Thanks.

Yes, I’ve tried that sort of thing myself. It seems that when you convert to a layer then there is a bunch of additional layer information that is written at the end of the layer information section. That certainly includes layer protection bits – the stuff that says whether you can edit various aspects of the layer.

Unfortunately this doesn’t seem to solve my problem. Even if I explicitly set all the protection bits to zero (which is the default anyway) then my layers are still "partially locked" whenever I set their type to normal and their transparency to fully opaque. I only get this problem with greyscale images and not rgb images – very strange.

Thanks again.
Fred
J
jenelisepasceci
Apr 26, 2005
"Fred" wrote:

"Peter Wollenberg" wrote in message


Unfortunately this doesn’t seem to solve my problem. Even if I explicitly set all the protection bits to zero (which is the default anyway) then my layers are still "partially locked" whenever I set their type to normal and their transparency to fully opaque. I only get this problem with greyscale images and not rgb images – very strange.
….
A workaround might be to create files in indexed color with the palette set to 256 shades of grey, if this is allright with your customer.
BTW, the ADOBE developper forum might be a better place to ask that kind of questions.
Greetings,
Peter
F
Fred
Apr 26, 2005
"Peter Wollenberg" wrote in message
"Fred" wrote:

BTW, the ADOBE developper forum might be a better place to ask that kind of questions.

Thanks for that useful tip.
Do you have any further info on the ADOBE developer forum – is it run by Adobe for example?

Thanks
Fred
J
jenelisepasceci
Apr 26, 2005
"Fred" wrote:

….
Do you have any further info on the ADOBE developer forum – is it run by Adobe for example?
Indeed:

http://partners.adobe.com/public/developer/photoshop/devcent er.html

Peter
T
toby
Apr 26, 2005
Fred wrote:
Hello

I’m not an experienced Photoshop user and I’m trying to write out
some
multi-layered psd files from a proprietary application. I’m using my
own
code and the Adobe PhotoShop file format description to do this.
The resultant file is mostly right but my user complains that the
layers are
partially locked ….

This may or may not help, but I have written a program that can inspect and dump PSD files in some detail; source code is available at http://www.telegraphics.com.au/svn/psdparse/ (Subversion repository).

Many Thanks
Fred
F
Fred
Apr 26, 2005
"toby" wrote in message
This may or may not help, but I have written a program that can inspect and dump PSD files in some detail; source code is available at http://www.telegraphics.com.au/svn/psdparse/ (Subversion repository).

Thanks – that looks like it could be really useful.

But I’m afraid I’m not familiar with Subversion…
If I follow the links to Subversion on the above Url, should I be able to download a set of code that I can build in Windows 2000 using Visual Studio? Will I need to install some other apps as well?

Thanks for your help

Fred
T
toby
Apr 27, 2005
Fred wrote:
"toby" wrote in message
This may or may not help, but I have written a program that can
inspect
and dump PSD files in some detail; source code is available at http://www.telegraphics.com.au/svn/psdparse/ (Subversion
repository).

Thanks – that looks like it could be really useful.

Fred, to answer your questions:

But I’m afraid I’m not familiar with Subversion…
If I follow the links to Subversion on the above Url, should I be
able to
download a set of code

Yes; here are several ways you can do that:

* use ViewCVS’ interface to download a tar archive from the repository: see the link at the bottom of
http://www.telegraphics.com.au/viewcvs/branches/psdparse_cj/ ?root=psdparse

* use the Subversion CLI tools
( http://subversion.tigris.org/servlets/ProjectDocumentList?fo lderID=91) to check out the source:

svn checkout
http://www.telegraphics.com.au/svn/psdparse/branches/psdpars e_cj/

* if you prefer GUI, use TortoiseSVN to do it within Windows Explorer (http://tortoisesvn.tigris.org/download.html)

…that I can build in Windows 2000 using Visual Studio?

It will build with VS or a variety of other Windows compilers, but I have not provided makefiles or project files for them. A CodeWarrior 7 project is provided.

Will I need to install some other apps as well?

No; it’s self-contained. And to save you the trouble of building it, here’s a pre-built DOS console app that produces a verbose dump: http://www.telegraphics.com.au/sw/files/psddump-1.3b3-win.zi p

Thanks for your help

Most welcome. If you have any issues or questions, don’t hesitate to e-mail.

Toby

Fred
F
Fred
Apr 27, 2005
"toby" wrote in message
Fred wrote:

No; it’s self-contained. And to save you the trouble of building it, here’s a pre-built DOS console app that produces a verbose dump: http://www.telegraphics.com.au/sw/files/psddump-1.3b3-win.zi p

Just a quick note to say thanks.
I used the Dos app to compare two similar files (one that was ok, one that wasn’t).
I’ve sorted my issue out now – just needed to add another transparency channel to all my layers!

Thanks again
Fred

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

Related Discussion Topics

Nice and short text about related topics in discussion sections