Modify text layer in a TIFF (or PSD) image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
stylesheets
Posts: 2
Joined: 2017-04-01T05:40:10-07:00
Authentication code: 1151

Modify text layer in a TIFF (or PSD) image

Post by stylesheets »

Hi,

I need to process some images:
  • Read a PSD (or TIFF) image. My images consist of a background image and a text layer (with PSD styles applied to it)
  • Modify a text layer without losing the layer styling
  • Save to PNG
I'm really new to ImageMagick, but it seems from other posts in this forum that this can be done.

Ideally, I need to proceed either via command line or using .NET

Any help on how to do this would be more than welcome!

Cheers!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Modify text layer in a TIFF (or PSD) image

Post by snibgo »

IM is a raster image processor. It can read raster images from PSD files, and some metadata. But a PSD text layer doesn't (as far as I know) store the text in a form that IM can read or write.

To modify the text layer of a PSD, a Photoshop script seems the obvious tool.
snibgo's IM pages: im.snibgo.com
stylesheets
Posts: 2
Joined: 2017-04-01T05:40:10-07:00
Authentication code: 1151

Re: Modify text layer in a TIFF (or PSD) image

Post by stylesheets »

snibgo wrote: 2017-04-01T06:28:56-07:00 IM is a raster image processor. It can read raster images from PSD files, and some metadata. But a PSD text layer doesn't (as far as I know) store the text in a form that IM can read or write.

To modify the text layer of a PSD, a Photoshop script seems the obvious tool.
I'd like to stay away from photoshop, would this be possible if I used TIFF files?

Thank you!
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Modify text layer in a TIFF (or PSD) image

Post by Bonzo »

I would delete the text layer and start from fresh. I do not see how you can read any styling etc. from a raster image.

You could possibly use some OCR to read the text.
I'm really new to ImageMagick, but it seems from other posts in this forum that this can be done.
What are these posts?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Modify text layer in a TIFF (or PSD) image

Post by snibgo »

As Bonzo says, if your text has been rasterized, then OCR might get the text back, as text.
stylesheets wrote:... would this be possible if I used TIFF files?
Try it and see. Create a text layer in PS, save as both PSD and TIFF. Then try:

Code: Select all

identify -verbose yourfile.psd
identify -verbose yourfile.tiff
Does your text appear in the output? Also try exiftool.
snibgo's IM pages: im.snibgo.com
Post Reply