Luminous Landscape Forum

Raw & Post Processing, Printing => Digital Image Processing => Topic started by: Slobodan Blagojevic on January 26, 2016, 09:22:06 pm

Title: Help with extracting letters
Post by: Slobodan Blagojevic on January 26, 2016, 09:22:06 pm
I would appreciate some ideas about the best way to extracts letters from an image. The letters could be extracted as an outline, to be filled with another color, or they could retain the color and brightness of the original (but eliminate the gray background). Once extracted, they would be merged with another image with a white background. I tried "select color range" in PS, but because of the uneven lighting, it picks either some background or leaves some letters out. I am on LR/PS CC 2015.

Title: Re: Help with extracting letters
Post by: Schewe on January 26, 2016, 10:11:01 pm
I would appreciate some ideas about the best way to extracts letters from an image.

Sadly, in my experience, the only way to do that is using Photoshop's Path tool. Yes, it's time consuming and tedious but that's really the only way to get a clean, accurate outline. Over the years, I got really quick and accurate using the Path tool. One trick is to turn on the Rubber Band option in the Tools Option.
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 26, 2016, 10:35:19 pm
Sadly, in my experience, the only way to do that is using Photoshop's Path tool...

I was afraid you are going to say that ;)
Title: Re: Help with extracting letters
Post by: langier on January 26, 2016, 10:59:43 pm
Добер вече, Слободан!

Faster and easier than the path tool would be using the Select->Color Range tool. Use the eyedropper tool to expand the color. It's not perfect but will get you most of the way there. You can adjust the tolerance and can use the other selection tools to modify your selection.

The other way is to use the Quick-Select tool (It may be under the tragic-wand tool). This tool does magic!

If you need to add or subtract from the election, you can use some of the other tools.

I generally will build a mask on a separate layer of my selection so I can select little-by-little. Once I'm happy with the mask, then I'll save it and then use the "tragic wand" to select what I wish to copy.

If needed, you can use an adjustment layer to pop the color or contrast. I usually will use a curves layer and either pop the contrast with a curve or Blend->Screen to lighten the image a stop. You can also use vibrance, saturation and other layer effects.

Either will save you hours of piddling with the path tool.

Another possibility is to open the image in Illustrator and use the auto-trace tool.

Надам се да ће ово помоћи, мој пријатељу!
Title: Re: Help with extracting letters
Post by: sniper on January 27, 2016, 03:05:52 am
If you have illustrator auto trace might work, I've used it for similar things in the past but I'm away from the studio so I cant test it for you.
Title: Re: Help with extracting letters
Post by: tom b on January 27, 2016, 05:02:53 am
My thought is that the background is much more continuous, you could select it and then invert the  selection.

You could use the Marquee Tool to draw rectangles around the groups of letters and then copy and paste in place to further make selection easier.

Then use the Magic Wand Tool to make your selections.

Cheers,
Title: Re: Help with extracting letters
Post by: rdonson on January 27, 2016, 06:47:20 am
I agree with Jeff.  Perhaps the pen tool to create the paths.  Tedious but best results.
Title: Re: Help with extracting letters
Post by: TonyW on January 27, 2016, 10:51:14 am
Several methods quoted all sound reasonable.  I agree that the pen tool probably best as you could scale if required without IQ penalty.

Still another way is to make use of Channels to create a mask.  Two issues with this 1. your image shows two drop shadows which you would not retain and need to add back and 2. potential for poor lost edges.

Not to be put off I had a quick using a copy of the red channel with a touch of levels, apply image and overlay painting white and black.  Attached is the result.  BTW hope this in order I am aware of your copyright and will remove image if required
Title: Re: Help with extracting letters
Post by: AFairley on January 27, 2016, 11:59:15 am
If you first use the lasso tool to make a close selection of the letters and then the color range selector (which will select colors only inside the lasso-selected area), that will mitigate the effect of the variable background and you may be able to get a clean selection of the letters.
Title: Re: Help with extracting letters
Post by: Bart_van_der_Wolf on January 27, 2016, 12:13:34 pm
Several methods quoted all sound reasonable.  I agree that the pen tool probably best as you could scale if required without IQ penalty.

Still another way is to make use of Channels to create a mask.  Two issues with this 1. your image shows two drop shadows which you would not retain and need to add back and 2. potential for poor lost edges.

Not to be put off I had a quick using a copy of the red channel with a touch of levels, apply image and overlay painting white and black.  Attached is the result.  BTW hope this in order I am aware of your copyright and will remove image if required

I agree with Tony. While creating a path with the pen tool, or with an auto trace (e.g. with InkScape (https://inkscape.org/en/download/), or Illustrator), is the best to create a selection that scales at high quality, it is a cumbersome process.

Masking also has its benefits, especially if you first enlarge the image to the required final output size, selections can be very accurate. To aid in smooth edge selections, you can also use a Photoshop custom filter (see attached) to trace the exact edge positions. Preblurring a bit or enlarging before applying the filter will smoothen the edge aliasing.

Cheers,
Bart
Title: Re: Help with extracting letters
Post by: kirkt on January 28, 2016, 08:57:24 am
Not to be put off I had a quick using a copy of the red channel with a touch of levels, apply image and overlay painting white and black.  Attached is the result.  BTW hope this in order I am aware of your copyright and will remove image if required

This is how I approached it - I brought the result into Illustrator and used Auto Trace to make a vectorized version of the resulting logo art.

kirk
Title: Re: Help with extracting letters
Post by: TonyW on January 28, 2016, 12:44:23 pm
This is how I approached it - I brought the result into Illustrator and used Auto Trace to make a vectorized version of the resulting logo art.

kirk
Interesting, as I do not have access to Illustrator can I ask how much work/time you think it would take to edit the vector image to acceptable levels for reasonable enlargement?
Title: Re: Help with extracting letters
Post by: Peano on January 28, 2016, 12:58:44 pm
Is it possible to re-shoot the image? You're starting with the handicap of a small image and poor lighting. A high-res image with decent lighting might make this job a whole lot easier.

You might also farm this out to one of the overseas clipping mask services. They work dirt cheap and could deliver a vector image for under $5. Here (http://photomasking.com/) is one example (base price $3 per image). Google photo masking services. There are tons of them.
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 28, 2016, 01:35:57 pm
Is it possible to re-shoot the image? You're starting with the handicap of a small image and poor lighting. A high-res image with decent lighting might make this job a whole lot easier.

You might also farm this out to one of the overseas clipping mask services. They work dirt cheap and could deliver a vector image for under $5. Here (http://photomasking.com/) is one example (base price $3 per image). Google photo masking services. There are tons of them.

The original file is 50 Mpx. The lighting might be improved, however, given the high reflectivity of the letters I doubt the result would be significantly different. I guess I could erect a frosted shower curtain in front of it and light it up from behind with strobes, but that seems even more hassle than a pen tool.

Outsourcing clipping/masking could be a good idea, though.
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 28, 2016, 01:36:38 pm
Thanks everyone for the input. I'll keep you posted.
Title: Re: Help with extracting letters
Post by: Peano on January 28, 2016, 01:46:48 pm
The original file is 50 Mpx. The lighting might be improved, however, given the high reflectivity of the letters I doubt the result would be significantly different. I guess I could erect a frosted shower curtain in front of it and light it up from behind with strobes, but that seems even more hassle than a pen tool.

Outsourcing clipping/masking could be a good idea, though.

Sorry, I should have been more specific about the lighting problems. If the color of the letters were more evenly illuminated, that color could then be enhanced (increased saturation) and perhaps shifted to a different hue in Photoshop. Such adjustment often make it very easy to then use calculations to create a clean mask. Perhaps using a diffuser on the strobe and bouncing off the ceiling would do the job.
Title: Re: Help with extracting letters
Post by: Rajan Parrikar on January 28, 2016, 02:10:45 pm
Have you tried the Topaz ReMask plugin?
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 28, 2016, 03:04:30 pm
...If the color of the letters were more evenly illuminated...

Indeed. It was more of a grab shot, during a visit with a different purpose. The store had several customers moving around and it wasn't easy to find a proper vantage point. Had I expected such a trouble with extracting, I would have paid more attention to the reflections or waited for an empty store.
Title: Re: Help with extracting letters
Post by: kirkt on January 28, 2016, 03:27:25 pm
Interesting, as I do not have access to Illustrator can I ask how much work/time you think it would take to edit the vector image to acceptable levels for reasonable enlargement?

I did not really play around with it.  The Image Trace engine has some controls that permit you to specify the amount of control points on the curves that it fits, the number of curves it fits, etc.  You could probably get pretty close without much extra work if you create a clean image like yours.  It would probably also depend on the final application for the vector art and how precise it needs to be.

kirk

EDIT - I copied Tony's logo and brought it into Illustrator and produced the attached in a few seconds with Image Trace - it is a PNG (has transparency) at 300dpi exported from Illustrator.  The vector could use a little clean up, but is a pretty good starting point out of the box.
Title: Re: Help with extracting letters
Post by: TonyW on January 28, 2016, 04:10:29 pm
I did not really play around with it.  The Image Trace engine has some controls that permit you to specify the amount of control points on the curves that it fits, the number of curves it fits, etc.  You could probably get pretty close without much extra work if you create a clean image like yours.  It would probably also depend on the final application for the vector art and how precise it needs to be.

kirk

EDIT - I copied Tony's logo and brought it into Illustrator and produced the attached in a few seconds with Image Trace - it is a PNG (has transparency) at 300dpi exported from Illustrator.  The vector could use a little clean up, but is a pretty good starting point out of the box.
I think a pretty good job considering you copied the logo I submitted.  This was not intended to be perfect and just proof of concept.  On my version you will see the missing/ dark areas on the 'e' curlicues as one example.  This could/would be improved working on the full size raw image and taking a little time and care getting a better looking start for auto trace to do its job

Title: Re: Help with extracting letters
Post by: SZRitter on January 28, 2016, 04:43:34 pm
I'm just curious, if this is just an exercise for exercise's sake, or if this is actually for a client. If for a client, have you contacted the sign maker to see if they still have the vector for the sign?

As for an answer, I have a good friend who is a sign maker, and he is often stuck making vectors from things like this. He usually, if I understand his process correctly, boosts the contrast as much as possible to get defined edges then uses live trace or traces it by hand (Wacom tablets are grand). Expect cleanup for a lot of things after the trace.
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 28, 2016, 04:54:24 pm
I'm just curious, if this is just an exercise for exercise's sake, or if this is actually for a client. If for a client, have you contacted the sign maker to see if they still have the vector for the sign?...

I am actually preparing a jewelry image (square) for the client and this would go as a logo underneath, on a 20"x30" image size. Good idea about the sign maker, will have to check with the client.
Title: Re: Help with extracting letters
Post by: BobDavid on January 29, 2016, 10:37:11 am
If they work with a graphic designer, I'm sure there is a vectorized version--especially for business cards, collateral, etc. Maybe the client has files available.
Title: Re: Help with extracting letters
Post by: tom b on January 29, 2016, 11:31:40 am
Yep, an interesting Photoshop question. Copyright however, is a whole new ball game.

Cheers,
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 29, 2016, 01:34:27 pm
Copyright however, is a whole new ball game...

What do you mean by that?
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 29, 2016, 01:53:29 pm
It is pretty simple, you are trying to copy a copyright logo....

Except for the fact that the owner of the logo hired me to do it.
Title: Re: Help with extracting letters
Post by: tom b on January 29, 2016, 02:13:36 pm
There is a disconnect, any professional logo has many uses, stationery, branding, hoardings or whatever. I would be very sceptical of any company that says it has the copyright to a logo but doesn't have files to reproduce the logo.

Cheers,
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 29, 2016, 02:36:11 pm
...I would be very sceptical of any company that says it has the copyright to a logo but doesn't have files to reproduce the logo.

I would be skeptical too, if the owner of, say, this business:

"Shoe Repair by Tom"

would ask me to do a logo for:

"Fiancee Jewelry by Pierre"

 ;)

For what it is worth, I am in the process of obtaining those files.
Title: Re: Help with extracting letters
Post by: SZRitter on January 29, 2016, 02:40:47 pm
There is a disconnect, any professional logo has many uses, stationery, branding, hoardings or whatever. I would be very sceptical of any company that says it has the copyright to a logo but doesn't have files to reproduce the logo.

Cheers,

I wouldn't be. I see it all too often, small businesses go out and get a logo made by a designer (or signmaker/print shop for that matter), and they don't retain any files themselves. Most business owners don't understand what a vector copy of the logo is, let alone why they should save the file. And I would be skeptical of any designer that, after making the logo, doesn't give the client unlimited reproduction rights.
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 29, 2016, 02:45:51 pm
I wouldn't be. I see it all too often, small businesses go out and get a logo made by a designer (or signmaker/print shop for that matter), and they don't retain any files themselves. Most business owners don't understand what a vector copy of the logo is, let alone why they should save the file. And I would be skeptical of any designer that, after making the logo, doesn't give the client unlimited reproduction rights.

Thank you, that is exactly the case.
Title: Re: Help with extracting letters
Post by: tom b on January 29, 2016, 02:59:39 pm
"And I would be skeptical of any designer that, after making the logo, doesn't give the client unlimited reproduction rights."

WTF, photographers keep their copyright but designers just give up their copyright! It is a strange, strange world.

"Most business owners don't understand what a vector copy of the logo is, let alone why they should save the file."

Yep, and they don't understand copyright.

Cheers,

Title: Re: Help with extracting letters
Post by: Peano on January 29, 2016, 03:09:27 pm
If you're not an attorney who specializes in copyright law, it's a probably wise not to offer advice about copyright issues. It's an extremely complex area of law. Even attorneys who don't specialize in it will usually hesitate to offer advice.
Title: Re: Help with extracting letters
Post by: SZRitter on January 29, 2016, 03:13:24 pm
"And I would be skeptical of any designer that, after making the logo, doesn't give the client unlimited reproduction rights."

WTF, photographers keep their copyright but designers just give up their copyright! It is a strange, strange world.

"Most business owners don't understand what a vector copy of the logo is, let alone why they should save the file."

Yep, and they don't understand copyright.

Cheers,

*cough* read better*cough*

I said "unlimited reproduction rights", that isn't the same as copyright. The designer can still hold the copyright but allow the client to reproduce as they see fit. In the case of logos, I would argue that is extremely common, as how many of us want to pay for a logo only to be used once? And many photographers do the same with their images. Companies, such as the one I work for, like to have catalogs of images they can go to anytime and use as they need, instead of contacting the photographer and paying each time we use it. We, of course, pay the rate the photographer negotiates full well knowing this is the case, plainly written in the contract.
Title: Re: Help with extracting letters
Post by: SZRitter on January 29, 2016, 03:15:33 pm
If you're not an attorney who specializes in copyright law, it's a probably wise not to offer advice about copyright issues. It's an extremely complex area of law. Even attorneys who don't specialize in it will usually hesitate to offer advice.

I wish there was a way to upvote this. And yes, I realize that is kind of what I am doing, and probably should shut my own mouth.
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 29, 2016, 03:23:12 pm
WTF, photographers keep their copyright but designers just give up their copyright! It is a strange, strange world...

Yes, especially when you don't know enough about it.

Photographers also "give up" their copyright when they do "work for hire," just as logo designers do. Or they give unlimited reproduction rights. Or transfer their copyright, etc.
Title: Re: Help with extracting letters
Post by: tom b on January 29, 2016, 03:39:29 pm
Yes, especially when you don't know enough about it.

Photographers also "give up" their copyright when they do "work for hire," just as logo designers do. Or they give unlimited reproduction rights. Or transfer their copyright, etc.

Yes, and if they do they give their files to the client.

The missing part of the equation. Why not just go to the source?

Cheers,
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on January 29, 2016, 03:49:24 pm
... The missing part of the equation. Why not just go to the source?...


... I am in the process of obtaining those files.

Title: Re: Help with extracting letters
Post by: Peano on January 29, 2016, 07:19:04 pm
Not to beat a dead lawyer, but here is one of my favorite examples of the difficulty of copyright law:

Jones, a photographer and graphic designer, creates a poster for a band to use on a concert tour. The next year, another poster, another tour -- and so on for many years. Smith, an author, decides to write a history of the band covering 30 years of its career. He discovers the posters produced over the years by Jones, who still holds the copyright.

Smith negotiates with Jones to use the posters in his book, but they can’t agree on a fee. So Smith decides to use the posters anyway. He places reduced copies of the images throughout his book to illustrate the group’s concerts over the years.

Jones sues Smith for copyright infringement. Smith claims it’s fair use, so he didn’t violate the copyright.

I think most laymen would say that Jones should prevail, because Smith used Jones's images without permission or compensation and even published them in a book that Smith then sold for profit. But in fact (and this was an actual case (http://fairuse.stanford.edu/primary_materials/cases/GrahamKindersley.pdf)), Smith prevailed twice -- once at the trial level and again on appeal. Both courts ruled that it was fair use, no copyright violation.

If you find that perplexing, take it as a lesson in the perplexities and complexities of copyright law.
Title: Re: Help with extracting letters
Post by: Slobodan Blagojevic on April 22, 2016, 06:32:42 pm
Thanks everyone for the input. I'll keep you posted.

Once again, thanks everyone for the input. In the meantime, I got the original vector file from the sign maker to combine with my photographs and this is the result:
Title: Re: Help with extracting letters
Post by: Eric Myrvaagnes on April 23, 2016, 12:03:21 am
Very classy result. I'm glad you were able to get the original vector file.