Color profiles and fonts for embedded text
-
- Posts: 5
- Joined: 2015-11-09T10:18:16-07:00
- Authentication code: 1151
Color profiles and fonts for embedded text
I am using ImageMagick via the command line for a client to convert EPS and PSD images. For the PSD images, we are selecting different layers and creating new, flat JPEG images from the PSD layers using the convert tool. What my client wants me to do is to be able to explain how the color profiles with when there is a profile embedded in the PSD image and how to ensure that the text layers are bold instead of standard fonts. It looks like the -font and -profile options only work for color profile files and the fonts of text passed in from the command line. Is there a way to ensure that an embedded profile and font can be changed or used?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Color profiles and fonts for embedded text
IM does not know about text fonts in PSD or EPS files, as far as I know. I suppose the information is in the EPS and PSD file. However, it only treats files as raster data. Vector files such as EPS are converted to raster pixel data. So I do not think you can change fonts or make text bolder. You can detect and change profiles, however, with the -profile command. See
http://www.imagemagick.org/Usage/formats/#vector
http://www.imagemagick.org/Usage/formats/#profiles
http://www.imagemagick.org/script/escape.php
http://www.imagemagick.org/Usage/formats/#vector
http://www.imagemagick.org/Usage/formats/#profiles
http://www.imagemagick.org/script/escape.php
Re: Color profiles and fonts for embedded text
Would the absence of the correct font on the system prevent ImageMagick from rasterizing the font layer correctly?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Color profiles and fonts for embedded text
That could be especially for the EPS, but only as far a reading the the font, not changing it. IM cannot change fonts as far as I know. But I am not an expert on that. Have you tried downloading the needed font and see if that makes a difference.
What is your IM version and platform?
If you are having a specific issue, perhaps you can post the image to some free hosting service such as dropbox.com and put the URL here. Then post your command line and explain what is wrong with the output.
What is your IM version and platform?
If you are having a specific issue, perhaps you can post the image to some free hosting service such as dropbox.com and put the URL here. Then post your command line and explain what is wrong with the output.
-
- Posts: 5
- Joined: 2015-11-09T10:18:16-07:00
- Authentication code: 1151
Re: Color profiles and fonts for embedded text
Version: ImageMagick 6.9.1-4 Q16 x86_64 2015-08-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP
Delegates (built-in): bzlib fontconfig freetype jng jpeg lcms lzma pangocairo png tiff x xml zlib
The platform it is running on is Linux.
The issue is that the client I am working for wants to apply color profiles at will and some PSD images will have color profiles and some may not. Then want to easily manage which color profile they are using and also want to know for certain how IM handles color profiles and text attributes with embedded text layers.
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP
Delegates (built-in): bzlib fontconfig freetype jng jpeg lcms lzma pangocairo png tiff x xml zlib
The platform it is running on is Linux.
The issue is that the client I am working for wants to apply color profiles at will and some PSD images will have color profiles and some may not. Then want to easily manage which color profile they are using and also want to know for certain how IM handles color profiles and text attributes with embedded text layers.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Color profiles and fonts for embedded text
As far as I know, IM does not know about text layers as text. I assume they get rasterized in IM so the text information such as font, etc is lost.The issue is that the client I am working for wants to apply color profiles at will and some PSD images will have color profiles and some may not. Then want to easily manage which color profile they are using and also want to know for certain how IM handles color profiles and text attributes with embedded text layers.
As for the profiles, that IM can handle. You need to use the string formats/escapes to detect what profile is in the image. Then use -profile (one or two of them to either change or reassign if it is not included).
see
http://www.imagemagick.org/script/escape.php
Regarding the string escapes:
%[profile:icc] ICC profile info
%[profile:icm] ICM profile info
%[profiles] list of any embedded profiles
for example
Code: Select all
convert image -format "%[profiles]" info:
and see
http://www.imagemagick.org/Usage/formats/#profiles
regarding the profile changes.
If the image has a profile already, then just do
Code: Select all
convert image -profile path2/someprofile result
If the image does not have a profile or you use -strip to remove the profile, then you have to specify a new profile for the image depending upon the colorspace (sRGB or CMYK) and then change it
Code: Select all
convert image -profile path2/profile1 -profile path2/profile2 result
So you need write a short script to check the profile(s) escape and the colorspace escape and determine if you need one or two profiles and then use an conditional to specify the IM convert command line.
-
- Posts: 5
- Joined: 2015-11-09T10:18:16-07:00
- Authentication code: 1151
Re: Color profiles and fonts for embedded text
fmw42, I understand all of that. I was wondering if there was a better way to do it than that and the client wants 100% verification of how it all works. I could not find a way to select or use profiles embedded in the image and it looks like not. I've told them that we need a profile file if they want to always apply a given profile. It may be easiest to just get the profile they want in a file then always apply that profile when converting an image rather than adding the steps of checking to see if it exists and then changing the command line based on that.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Color profiles and fonts for embedded text
If a file has an embedded profile, you can extract it, eg:WasabiSailor wrote:I could not find a way to select or use profiles embedded in the image and it looks like not.
Code: Select all
convert in.tiff out.icc
snibgo's IM pages: im.snibgo.com
-
- Posts: 5
- Joined: 2015-11-09T10:18:16-07:00
- Authentication code: 1151
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Color profiles and fonts for embedded text
What if the embedded profile is icm? Don't you need to use the %[profiles] to find out which one it is first or even if there is one or not?snibgo wrote: If a file has an embedded profile, you can extract it, eg:Then you can use out.icc wherever you want.Code: Select all
convert in.tiff out.icc
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Color profiles and fonts for embedded text
Also if the profile is in the image, then why do you need to extract it? You just need to use one -profile with the new profile you desire to change to.
The only reason for needing to extract it is if you do not have that profile and want to strip all the meta data from the image. Then you would need to extract the profile, strip the image, then use two profiles (the one extracted followed by the new one you want to have for the output image). I have shown how to do that above by testing for profiles and then using one or two profiles to convert the image.
The only reason for needing to extract it is if you do not have that profile and want to strip all the meta data from the image. Then you would need to extract the profile, strip the image, then use two profiles (the one extracted followed by the new one you want to have for the output image). I have shown how to do that above by testing for profiles and then using one or two profiles to convert the image.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Color profiles and fonts for embedded text
Perhaps snibgo's suggestion to extract the profile would make sense if you want to confirm that the output has that profile. But you can also do that by using the %[profiles] and %[profile] escapes on the output image.
-
- Posts: 5
- Joined: 2015-11-09T10:18:16-07:00
- Authentication code: 1151
Re: Color profiles and fonts for embedded text
This client is rather particular. I think they've decided how to deal with this now. Some of their images have a color profile and some don't. They wanted to make sure how it worked and what could be done to ensure that a profile was applied to every image. They have decided to handle this post conversion now because they want to be subjective in the application and that is hard to do in code.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Color profiles and fonts for embedded text
I've never played with icm profiles. I seem to recall they are the same as icc, just with a different name, but I could be wrong.
Extracting colour profiles from images doesn't seem very useful to me, but WasabiSailor seemed to want it, and it is possible.
Images with RedGreenBlue channels and no profile are generally assumed to be sRGB. CMYK files with no profile are more problematic.
Extracting colour profiles from images doesn't seem very useful to me, but WasabiSailor seemed to want it, and it is possible.
Images with RedGreenBlue channels and no profile are generally assumed to be sRGB. CMYK files with no profile are more problematic.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Color profiles and fonts for embedded text
I did not know if they were different or not. But looking into it and according to http://www.xrite.com/ezcolor/support/kb2994, they are the same, but icm is used by Microsoft vs icc for other systems.