Cylindrical Distortion (bottle label)

Posted on 2008-06-12
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 125 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to grow an item in CorelDraw7 6 73
Error during copy and paste 3 104
Need a poor man's PowerPoint 5 130
Sources to create infographic resume 2 21
Introduction When sharing photos, especially via e-mail, the large resolution images that most cameras take today make for extremely large file sizes. The time required to upload these files to forums, send in e-mails, post to blogs or even placi…
Read about why website design really matters in today's demanding market.
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to correct colors in Photoshop using the Color Balance adjustment Open a photo for editing in Photoshop: Open a photo for editing in Photoshop: Select "OK" on the dialogue: The Color Balance adjustment works b…

821 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