RetouchPRO

Go Back   RetouchPRO > Tools > Software > Photoshop Help
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read


Photoshop Help Tips, questions, and solutions for Adobe Photoshop users
One tip or question per thread, please

Gradient Transform

Reply
 
Thread Tools
  #1  
Old 10-21-2005, 04:47 PM
goose443's Avatar
goose443 goose443 is offline
Senior Member
 
Join Date: Aug 2004
Location: Los Angeles, CA
Posts: 225
Gradient Transform

Alright, here's a questions that has been bugging me for a while.

Suppose you want to stretch or squish an image. You could simply used the free transform tool and size the image however you would like.

Now suppose you want to stretch the same image but you want to do it in such a way that the left side of the image is anchored and the right side is moveable and the stretch occurs in a "gradient" from right to left such that the right side has the most stretch and decreases stretch as you travel from right to left so that the left side has no stretch at all.

I have made a very simple jpg to illustrate the point. The upper lines represent the original picture and the lower lines represent the stretched picture (of course the lines would also increase in thickness from left to right). Now in this instance I could have selected each line and transformed it but what I'm looking for is the ability to do this smoothly across the whole image.

This would have many very useful applications including simulating an image wrapping around a cylinder.

Maybe there's an easy answer but I haven't been able to find it.
Attached Images
File Type: jpg Transform.jpg (4.7 KB, 32 views)
Reply With Quote top
  #2  
Old 10-22-2005, 12:07 AM
Craig Walters's Avatar
Craig Walters Craig Walters is offline
Senior Member
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,786
Blog Entries: 4
i can think of two possibilities here. one, use the liquify tool (if you're using PS) or the warp mesh (if you're using psp). and two, make a custom displacement map and use the displacement map tool (PS and PSP).

Craig
Reply With Quote top
  #3  
Old 10-22-2005, 07:10 AM
edgework edgework is offline
Senior Member
 
Join Date: Jul 2004
Location: Brooklyn
Posts: 494
Quote:
Originally Posted by Kraellin
i can think of two possibilities here. one, use the liquify tool (if you're using PS) or the warp mesh (if you're using psp). and two, make a custom displacement map and use the displacement map tool (PS and PSP).

Craig
As you noted, Goose, stretching with transform is linear and the effect is spread evenly throughout the selection.

Regarding liquify: I use it a lot when I'm trying to deform text over a surface that recedes or curves away from the viewing plane, i.e. a logo on a football or basketball Use a large brush, large enough to cover the areas being deformed, a high Brush Density setting and a low Brush Pressure. The high density will minimize the natural tendency of the brush effect to be stronger in the middle, with the edges dragging along behind. Low pressure allows you to start with a small stroke at the edge and repeat, each time extending the sweep of the brush.

Another possibility: if you're actually trying for a perspective effect, and have CS2, pasting your gradient into a grid using the perspective tool would accomplish the task effortlessly. If you don't want the vanishing point, you still might be able to stretch the sides back out, depending on the type of image.
Reply With Quote top
  #4  
Old 10-23-2005, 08:01 PM
goose443's Avatar
goose443 goose443 is offline
Senior Member
 
Join Date: Aug 2004
Location: Los Angeles, CA
Posts: 225
Thanks for the tips. That's about as close as I've come myself. I was just hoping there was some more precise way of doing this type of transform. I think it would be useful for quite a few situations.
Reply With Quote top
  #5  
Old 10-24-2005, 03:39 AM
Panpan's Avatar
Panpan Panpan is offline
Senior Member
 
Join Date: Jun 2005
Location: Gatineau, QC Canada
Posts: 352
I tried with the displace filter. This meant a lot of tries because there is no visual feedback with this filter. I can now say that other ways like spherize, transform or liquify would be easier.

Basically I used the foreground-to-background gradient from 50% grey to black as the displacement map. I filled the rest of the map with 50% grey (for no displacement). This gives a full tube effect rather than the half tube you requested, but I figure that's even better if you want to wrap around a cylinder anyway.

I applied the map with displacement 350 horizontal and 0 vertical. That's where working blind was a pain. I had to try many values until I found 350. Note that this would change if the image size changed.

In the attachment, I show the displace map I built below. The result is on top.

The glass filter is similar to displace and gives visual feedback, but it does not seem to segregate horizontal and vertical displacements to separate channels (red and green) like displace; it seems to work only with the red channel to displace both directions at once.

So in the end, I would recommend something else if you want a non-linear transform.

Pierre
Attached Images
File Type: jpg Transform-panpan1.jpg (19.5 KB, 16 views)
Reply With Quote top
  #6  
Old 10-24-2005, 06:01 AM
Panpan's Avatar
Panpan Panpan is offline
Senior Member
 
Join Date: Jun 2005
Location: Gatineau, QC Canada
Posts: 352
To get a half-tube effect with a displacement map, using a foreground-to-background gradient of 50% grey to 25% grey doesn't work. It only gets you a full-tube effect half the size of the 50% to 0% gradient.

What you have to do is stretch the 50% to 0% gradient to twice the size of the selection. I've attached an example.

I had to fiddle with the horizontal displacement number again. I thought that since 350 worked for the full tube, 700 would work for the half-tube. The number I had to use was 585 .

Pierre
Attached Images
File Type: jpg Transform-panpan2.jpg (20.3 KB, 14 views)

Last edited by Panpan; 10-24-2005 at 06:06 AM.
Reply With Quote top
  #7  
Old 10-24-2005, 04:24 PM
goose443's Avatar
goose443 goose443 is offline
Senior Member
 
Join Date: Aug 2004
Location: Los Angeles, CA
Posts: 225
Thanks for the attempts Pierre. You got a lot farther than I did. I was wondering why there were multiple lines in your results and how that would translate to an actual photograph. In any event it's an innovative and impressive solution.

It's disappointing that Photoshop wouldn't come with a more straightforward filter for this sort of application. It seems like the type of situation people would fall into pretty frequently.
Reply With Quote top
  #8  
Old 10-24-2005, 08:42 PM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
Math 2
Curve It Squish
Cannify with Displace
Reply With Quote top
  #9  
Old 10-25-2005, 12:48 PM
goose443's Avatar
goose443 goose443 is offline
Senior Member
 
Join Date: Aug 2004
Location: Los Angeles, CA
Posts: 225
Stroker, looks like it's all in the displacement maps! Thanks for the links. I'll have to check them out at length when I have more time.
Reply With Quote top
  #10  
Old 10-26-2005, 09:19 PM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
Hi Goose.

Stroker writes some great stuff but he really Jumps in at the deep end. I tried reading his links but it just went way over my head.
This link is far more novice friendly and gives enough information to get this job done.
http://www.thegoldenmean.com/technique/displace1.html

I really want to learn about this filter as it is going to be useful with my next little project (Brush Strokes)

Here is a little summary of what I think I have learned so far. From Goldenmean, Worth and Stroker. I hope someone will correct me if I’m wrong.

A D-Map is a PSD file which will manipulate the pixels in another file.
Black moves pixels to the right and/or down. White moved pixels left and/or up
Mid gray in the D-Map produces no movement.
Channel one (Red) produces horizontal movement
Channel Two (Green) produces Vertical movement
The blue channel has no effect.

Goose wants to make a gradient going from no shift at the left to maximum shift at the right. Therefore you will need to construct a D-Map going from mid grey to black

You will only need channel one (Red) as you do not need to change the height.

I tried using your example but it was confusing because there is no reference. So I used a ruler (Courtesy of Stock Exchange)

If you want to play along please download 296245_8226.jpg (Attached)

Step 1.
Open 296245_8226.jpg. Click the channels. Fill the Blue and Green channels with 50% grey as they are not needed.
Fill the red channel with the gradient. Grey at the left and black at the right.
This should give you an image like in my attachment. (converted to jpg)
Save this as 296245_8226DM.PSD. (must be a PSD)

We now have our D-Map.

What we need to do now is enlarge our canvas to make room for the enlarged image so that it won’t get clipped.

Step2.
Open 296245_8226.jpg
Copy it to a new layer. Now go back to the bottom (background layer) and enlarge the canvas size.
Set the background colour to mid grey
Image > Canvas Size
Make the new canvas size 11 Inches Wide which will give plenty of room.
Anchor the picture at the left as we are expanding to the right.
You should have something similar to my attachment.

We are now ready to apply the D-Map.

Step 3
Select (click) the top layer

Filter > Distort > Displace.
This brings up a box and the settings are important.

Horizontal Scale (this will control the effect we want) Set it to 300
Vertical Scale. Set to 0
Stretch to Fit Checked
Repeat Edge Pixels Checked

Click OK and navigate to 296245_8226DM.PSD

And there you Go!
You should now have something similar to my last attachment
A Gradually stretched Image.

I hope this helps. I have certainly learnt a lot from this.
Any questions. Just ask and I’ll learn some more

Stroker where is that rock? This is really simple stuff to you but to a novice (me) it’s heavy going to start with.

Ken
Attached Images
File Type: jpg 296245_8226.jpg (16.7 KB, 12 views)
File Type: jpg 296245_8226DM_psd.jpg (14.5 KB, 6 views)
File Type: jpg 296245_8226_11Canvas.jpg (50.6 KB, 14 views)

Last edited by Cameraken; 10-26-2005 at 09:29 PM.
Reply With Quote top
Reply

  RetouchPRO > Tools > Software > Photoshop Help


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gradient Map Corrections snapshot Hidden Power Support 2 09-22-2007 07:29 PM
Gradient tool generates stripes stefan kanya Input/Output/Workflow 4 08-05-2006 02:24 AM
Replacing the Sky -- Using a Radial Gradient gmitchel Photo Restoration 0 10-16-2004 09:38 PM
Smoothing Large Blotches kthurner Image Help 15 01-14-2003 01:02 PM
Gradient Layer Mask Doug Nelson Photo Compositing 0 05-20-2002 01:28 AM


All times are GMT -6. The time now is 07:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2016 Doug Nelson. All Rights Reserved