Go Premium for a chance to win a PS4. Enter to Win


Cylindrical Distortion (bottle label)

Posted on 2008-06-12
Medium Priority
Last Modified: 2010-04-21
I have a photo of a label glued on a bottle.  The label is glued on the curved wall of the bottle and the bottle is cylindrical where the label is attached.

The photo is taken pretty much head on the bottle, and the middle of the label  is in correct proportions but the edges are compresses more and more near the ends.

How can I "flatten" the image of this label in Photoshop to get rid of the cylindrical distortion ?
Question by:verpies
  • 2
  • 2
LVL 26

Accepted Solution

David Brugge earned 375 total points
ID: 21775417
If the label wraps fully around the side of the bottle so that it disappears from view, there is no getting that information back

If, however, there is just a minor distortion, it can be compensated somewhat with the warp filter.

Remember that as you stretch the compressed areas of the image, they will not ever appear as sharp as the uncompressed areas because you are filling in between pixels with Photoshop's guess as to what those pixels should be.

That being said, enlarge your canvas to the size that the label would be if it were laid out flat.

Now, select the label area and go to Edit>Transform>Warp.

Your label will now have a grid over it with control points.

Start with the upper right control point and drag it to the right.

Now grab the lower right control point and drag it the same amount.

Now select the Bezier control for the upper right control point and move it to the right so that it is straight up and down

Do the same with the lower Bezier control point.

You should now have an image that is stretched out evenly from the center to the right.

Now grab the middle right control point at the top of the image and drag it to the left.

This is what restores the center part of your image and compensates for the original distortion. The relationship to the outer and inner control points is something that you have to play with in order to get the right amount of curve compensation.

After adjusting the top points to your satisfaction, drag the middle and bottom points so that thy line up under the top ones. (the middle points are where the grid lines cross)

The warp filter does not do a perfect job, because it tends to fall off at the outside edges. You may need to apply the filter several times to get the effect that you want.

Have fun, and best of luck.

Author Comment

ID: 21782047
The label wraps a little under 1/2 around the bottle.

I tried the warp filter but it does not do a perfect job, indeed.
I do not think the bezier curves can approximate the proper compresion of the label edges.

Ideally I would like to input the magnification factor as some kind of an approximation of the function 1/SQRT(1-(x^2/r^2)) which says that the center of the label gets no magnification (x=0) and the edges get an infinite magnification (x=-r or x=+r).  Eyeballing of the compression factors in 3 linear zones is really not what I was looking for.

Also, I do not have symmetrical reference points on my label to be sure that I am eyeballing it well, even if it was possible.

Is there any kind of a plugin  that does a cylindrical distortion ?

LVL 26

Expert Comment

by:David Brugge
ID: 21782219
I am not aware of any plugins that do this.

Here's another technique that we used to use before the days of the warp fillter.

Isolate the label onto a separate layer.

Switch to QuickMask mode and draw a Reflected Gradient from the center of your label to the outside edge.

The idea here being that the red area will protect the center (non compressed) area from being selected and the rest of the selection will continue with an even gradation from the center to the outside edge.

Switch back to standard mode.

Choose Edit>Transform and holding down the shift key, stretch the image to the new shape.

Here's what is happening. The stretch function is applied to each pixel on a logarithmic scale, applying the greatest amount of stretch on the outside edges and decreasing and it moves inward.

This method causes the image to become thin because it was being stretched into a blank space. To overcome this, duplicate the layer a dozen times or so (cmd+J) and selecting all of the layers merge them back into one (cmd+E)

This should give you more even and predictable results.

again, best of luck.

Author Closing Comment

ID: 31466519
I am awarding points to this solution because nobody posted a better one, despite that I could not use it.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

HOW TO CREATE A WEB 2.0 IMAGE WITH A REFLECTION I would like to start by saying I know Web 2.0 isn't a style. It is actually the practice of information sharing or  collaboration on the Web. It is also associated with the technology that is used …
In this article, I'll explain how to change the color of a selection in Photoshop. I'm sure there are a couple different ways to do this in photoshop, but this is my preferred method in Photoshop. I am using Photoshop CS6 and I will be adjusting the…
In this tutorial viewers will learn how to create a postcard text effect in Photoshop and get an introduction to Layer masks Use magic wand to select the "inner" part of the letters: Create a new layer and fill the selected area with black: Go back …
In this tutorial viewers will learn how to increase their history states in Photoshop To undo more than one history state, use Ctrl + Alt + Z, not just Ctrl + Z: View the History window by going to Window > History: The default number of history sta…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question