Create psd file with a single transparent layer
Create psd file with a single transparent layer
Hi guys,
I'm trying to create a Photoshop file: 16 bit, RGB, no alpha channel and just a single transparent layer, but no success.
I've tried a lot of cli settings/options and lately I tried to use a template file (a transparent png file with all the requirements above) and if I resize it and save it as a psd file I'll end up with a grayscale psd file with a black background.
Since I'm just resizing the image I would expect to the operation leaves all the other aspect of the image (channels, transparency, etc) intact but unfortunately it doesn't.
So, my question is, what is the best way to create an empty psd file described above?
Thanks in advance,
M
I'm trying to create a Photoshop file: 16 bit, RGB, no alpha channel and just a single transparent layer, but no success.
I've tried a lot of cli settings/options and lately I tried to use a template file (a transparent png file with all the requirements above) and if I resize it and save it as a psd file I'll end up with a grayscale psd file with a black background.
Since I'm just resizing the image I would expect to the operation leaves all the other aspect of the image (channels, transparency, etc) intact but unfortunately it doesn't.
So, my question is, what is the best way to create an empty psd file described above?
Thanks in advance,
M
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Create psd file with a single transparent layer
I am not sure I understand. Is it a totally transparent image you want to create or an image that has some transparency.
Please always provide your IM version and platform and your exact command line and/or your input image?
Please always provide your IM version and platform and your exact command line and/or your input image?
Re: Create psd file with a single transparent layer
Hi,
Thanks for the quick reply!
IM version: 6.6.3-0
I'd like to create a psd with a single, totally transparent layer.
Thanks in advance,
M
Thanks for the quick reply!
IM version: 6.6.3-0
I'd like to create a psd with a single, totally transparent layer.
Thanks in advance,
M
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Create psd file with a single transparent layer
That version of ImageMagick is over 350 versions old. If it is possible, you would likely need to upgrade. I will try to build one on a current version of ImageMagick and get back to you later today.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Create psd file with a single transparent layer
I tried all these commands.
I tried to load them into Photoshop CS (very old) and they all opened with one transparent layer and one channel labeled gray.
I am not sure what you expect.
Code: Select all
convert -size 500x500 xc:none -depth 8 PSD:test.psd
convert -size 500x500 xc:none -define tiff:alpha=unassociated tiff:- | convert - test_unassoc.psd
convert -size 500x500 xc:none -define tiff:alpha=associated tiff:- | convert - test_assoc.psd
convert -size 500x500 xc:none -define tiff:alpha=unspecified tiff:- | convert - test_unspec.psd
I am not sure what you expect.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Create psd file with a single transparent layer
This command should work, but does not.
colorspace:auto-grayscale=on|off
prevent automatic conversion to grayscale inside coders that support grayscale. This should be accompanied by -type truecolor. PNG and TIF do not need this define. With PNG, just use PNG24:image. With TIF, just use -type truecolor. JPG and PSD will need this define.
From the changelog:
2015-07-25 6.9.2-0 Dirk Lemstra <dirk@lem.....org>
Added "-set colorspace:auto-grayscale false" that will prevent automatic conversion to grayscale inside coders that support grayscale.
It looks like a bug when using PSD. Or possibly the code did not consider transparency.
Code: Select all
convert -size 500x500 xc:none -depth 8 -type truecoloralpha -define colorspace:auto-grayscale=off PSD:test_truecoloralpha.psd
prevent automatic conversion to grayscale inside coders that support grayscale. This should be accompanied by -type truecolor. PNG and TIF do not need this define. With PNG, just use PNG24:image. With TIF, just use -type truecolor. JPG and PSD will need this define.
From the changelog:
2015-07-25 6.9.2-0 Dirk Lemstra <dirk@lem.....org>
Added "-set colorspace:auto-grayscale false" that will prevent automatic conversion to grayscale inside coders that support grayscale.
It looks like a bug when using PSD. Or possibly the code did not consider transparency.
Re: Create psd file with a single transparent layer
Hi,
Thanks for all the suggestions!
Unfortunately, none of them give me the expected result.
As a matter of fact, only the first worked fine (but gave me a grayscale image with a black background and an alpha).
The last one didn't work at all but that's probably because of the old version I'm using.
The rest worked but the generated psd files were invalid, at least CS 2014 wasn't able to open them (the file size is suspiciously small compared to the others, for example the first generated a file ~500 kB, these files around ~60 kB).
Unfortunately, I can't update ImageMagick.
Thanks,
M
Thanks for all the suggestions!
Unfortunately, none of them give me the expected result.
As a matter of fact, only the first worked fine (but gave me a grayscale image with a black background and an alpha).
The last one didn't work at all but that's probably because of the old version I'm using.
The rest worked but the generated psd files were invalid, at least CS 2014 wasn't able to open them (the file size is suspiciously small compared to the others, for example the first generated a file ~500 kB, these files around ~60 kB).
Unfortunately, I can't update ImageMagick.
Thanks,
M
Re: Create psd file with a single transparent layer
Hi,
I've tried the latest version available on my Mac (using homebrew) and it's still doesn't give me the desired result.
Cheers,
M
I've tried the latest version available on my Mac (using homebrew) and it's still doesn't give me the desired result.
Cheers,
M
Re: Create psd file with a single transparent layer
You should use `-set colorspace:auto-grayscale false`. The -define will not set it as a property on the image but -set does. Do you get the correct result with the following command?
Code: Select all
convert -size 500x500 xc:none -depth 8 -set colorspace:auto-grayscale off test.psd
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Create psd file with a single transparent layer
Why is there a difference between -set and -define in this case?dlemstra wrote: ↑2017-12-26T11:27:29-07:00 You should use `-set colorspace:auto-grayscale false`. The -define will not set it as a property on the image but -set does. Do you get the correct result with the following command?
Code: Select all
convert -size 500x500 xc:none -depth 8 -set colorspace:auto-grayscale off test.psd
Re: Create psd file with a single transparent layer
The -define set properties on an internal object called ImageInfo. But the method that makes the image gray only has an Image as input and not an ImageInfo. To set a property on the image itself you will need to use -set instead of -define.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Create psd file with a single transparent layer
But -define has worked before on other images. Why is this different? Is it because it has transparency?
Re: Create psd file with a single transparent layer
I don't think the `-define` has ever worked on other images. Maybe that format did not try to make the image grayscale? Only some of the encoders will try to do that.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Create psd file with a single transparent layer
From the options page on define:
colorspace:auto-grayscale=on|off
prevent automatic conversion to grayscale inside coders that support grayscale. This should be accompanied by -type truecolor. PNG and TIF do not need this define. With PNG, just use PNG24:image. With TIF, just use -type truecolor. JPG and PSD will need this define.
So according to this, if I want to make a gray JPG or PSD, but have it report colorspace sRGB, then I should do the following. These both work according to identify -verbose, but %[colorspace] is in error.
sGray 0.454545
identify -verbose test.jpg
Colorspace: sRGB
Type: Grayscale
Gamma: 0.454545
sGray 0.454545
identify -verbose test.jpg
Colorspace: sRGB
Type: Grayscale
Gamma: 0.454545
colorspace:auto-grayscale=on|off
prevent automatic conversion to grayscale inside coders that support grayscale. This should be accompanied by -type truecolor. PNG and TIF do not need this define. With PNG, just use PNG24:image. With TIF, just use -type truecolor. JPG and PSD will need this define.
So according to this, if I want to make a gray JPG or PSD, but have it report colorspace sRGB, then I should do the following. These both work according to identify -verbose, but %[colorspace] is in error.
Code: Select all
convert -size 500x500 xc:gray50 -depth 8 -type truecolor -set colorspace:auto-grayscale off -format "%[colorspace] %[gamma]\n" -write info: test.jpg
identify -verbose test.jpg
Colorspace: sRGB
Type: Grayscale
Gamma: 0.454545
Code: Select all
convert -size 500x500 xc:gray50 -depth 8 -type truecolor -define colorspace:auto-grayscale=off -format "%[colorspace] %[gamma]\n" -write info: test.jpg
identify -verbose test.jpg
Colorspace: sRGB
Type: Grayscale
Gamma: 0.454545
Re: Create psd file with a single transparent layer
I've tried this one but it gave me a grayscale image with a transparent layer and an alpha channel.dlemstra wrote: ↑2017-12-26T11:27:29-07:00 You should use `-set colorspace:auto-grayscale false`. The -define will not set it as a property on the image but -set does. Do you get the correct result with the following command?
Code: Select all
convert -size 500x500 xc:none -depth 8 -set colorspace:auto-grayscale off test.psd
Then I've changed the command by adding "-type truecolor" (because I need an RGB image) and I got a grayscale image with a background layer and without alpha.
It feels like completely unpredictable when it comes to psd files...
All I wanted is a 16 bit, RGB image with single, transparent layer and no alpha channel.
Seems impossible now.
Cheers,
Imre