Custom Distort for printing on non-flat media
-
- Mitglied
- Posts: 109
- Joined: Sun 18 May 2003 02:02
Custom Distort for printing on non-flat media
Big picture: I'm using PhotoLine to make an image, to be "printed" (engraved) on a beer glass. Something like this:
The problem is that because the surface is not flat, the image appears distorted when viewed. That logo is actually a perfect circle (when measured on the physical glass), but appears as an elongated ellipse when viewed straight on (741 pixels wide and 847 high).
I am looking for some tool similar to the Distort tool, that allows images to be distorted in a non-linear way. In particular, to print on a cylinder, I would like some kind of arcsin(x) transformation Distort, that leaves y-coordinates unchanged. The left and right edges need to be stretched more than the center. EG, something that does this:
Before:
After:
Any suggestions?
The problem is that because the surface is not flat, the image appears distorted when viewed. That logo is actually a perfect circle (when measured on the physical glass), but appears as an elongated ellipse when viewed straight on (741 pixels wide and 847 high).
I am looking for some tool similar to the Distort tool, that allows images to be distorted in a non-linear way. In particular, to print on a cylinder, I would like some kind of arcsin(x) transformation Distort, that leaves y-coordinates unchanged. The left and right edges need to be stretched more than the center. EG, something that does this:
Before:
After:
Any suggestions?
-
- Betatester
- Posts: 4064
- Joined: Sun 03 Jul 2005 13:35
- Location: Mülheim/Ruhr
Re: Custom Distort for printing on non-flat media
Had a similar problem when I recreated the stencils of my bike, just the opposite way.
I pasted squared paper to the tubes, took a photo, then used the distort tool to turn everything into squares again.
For a moment I was also thinking about a more perfect tool, but then I considered focal length and didn't bother anymore. Good enough was simply really good enough, I could print, test and correct.
If you're looking for something perfect, then you'd have to consider the distance of the viewer. If you can't tell the distance, then a photo of wrapped squared paper and some manual distortion should be good enough.
I pasted squared paper to the tubes, took a photo, then used the distort tool to turn everything into squares again.
For a moment I was also thinking about a more perfect tool, but then I considered focal length and didn't bother anymore. Good enough was simply really good enough, I could print, test and correct.
If you're looking for something perfect, then you'd have to consider the distance of the viewer. If you can't tell the distance, then a photo of wrapped squared paper and some manual distortion should be good enough.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
-
- Mitglied
- Posts: 1675
- Joined: Mon 23 Dec 2019 15:21
- Location: Ukraine
Re: Custom Distort for printing on non-flat media
There is a Effects -> Effect Filters -> Projection -> Preset: Cylinder
Is it creates perspective in the way you need?
Is it creates perspective in the way you need?
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
-
- Mitglied
- Posts: 109
- Joined: Sun 18 May 2003 02:02
Re: Custom Distort for printing on non-flat media
Thanks for the responses, guys.
Hoogo - My problem is actually a bit harder than what I originally described, as my glasses are in the form of a conical frustum rather than a cylinder. The transformation I need is:
x' = R(1-y/H)*arcsin(x/(R(1-y/H))
y' = y (unchanged)
I am sympathetic to the idea of just settling for "good enough" rather than trying to make it "perfect". As you mention, it is only perfect if viewed from a particular distance and a particular angle.
I can't seem to find a way to transform in a non-linear fashion using the Distort tool.
shijan - Thanks for pointing out the Projection menu, which I had never used before. Those effects are really cool. Unfortunately, none of them have the transformation that I need to print on my glass. Conceivably it could be implemented as a custom Rotation file (.rot file), but I don't know how to do that.
Hoogo - My problem is actually a bit harder than what I originally described, as my glasses are in the form of a conical frustum rather than a cylinder. The transformation I need is:
x' = R(1-y/H)*arcsin(x/(R(1-y/H))
y' = y (unchanged)
I am sympathetic to the idea of just settling for "good enough" rather than trying to make it "perfect". As you mention, it is only perfect if viewed from a particular distance and a particular angle.
I can't seem to find a way to transform in a non-linear fashion using the Distort tool.
shijan - Thanks for pointing out the Projection menu, which I had never used before. Those effects are really cool. Unfortunately, none of them have the transformation that I need to print on my glass. Conceivably it could be implemented as a custom Rotation file (.rot file), but I don't know how to do that.
-
- Entwickler
- Posts: 4232
- Joined: Tue 19 Nov 2002 15:49
Re: Custom Distort for printing on non-flat media
You can non-linearly change the content of a layer by changing the helper points: You can set a precise precision by double-clicking a point. In the position dialog, you can also insert calculations, so you can simple append a "+ 50" to shift a point by 50 units.
Martin
You do not have the required permissions to view the files attached to this post.
-
- Betatester
- Posts: 4064
- Joined: Sun 03 Jul 2005 13:35
- Location: Mülheim/Ruhr
Re: Custom Distort for printing on non-flat media
I hope we're all talking about the same distort... There are some distort filters within Effects, there were some misunderstandings about that in the past.
You do not have the required permissions to view the files attached to this post.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
-
- Mitglied
- Posts: 1675
- Joined: Mon 23 Dec 2019 15:21
- Location: Ukraine
Re: Custom Distort for printing on non-flat media
Yep, it is Distort Tool in Toolbox
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
-
- Mitglied
- Posts: 109
- Joined: Sun 18 May 2003 02:02
Re: Custom Distort for printing on non-flat media
Thanks Martin, using the Distort Tool the way you suggest looks very promising- I tested it on paper. I'm going to test it on the laser tomorrow.
Is the Distort Tool available as an Adjustment Layer as well? That would be very helpful.
Is the Distort Tool available as an Adjustment Layer as well? That would be very helpful.
-
- Mitglied
- Posts: 615
- Joined: Thu 06 Oct 2011 08:08
-
- Mitglied
- Posts: 1675
- Joined: Mon 23 Dec 2019 15:21
- Location: Ukraine
Re: Custom Distort for printing on non-flat media
Probably Distort can't be Adjustment Effect because it is a Vector Effect, so same as all other vector effects you can enable/disable/edit it in Layer Attributes:
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
-
- Mitglied
- Posts: 254
- Joined: Sat 26 Jul 2014 10:13
- Location: California
Re: Custom Distort for printing on non-flat media
Quite a challenge! I think the only way to do it accurately is with scripting. I was going to write a PL script but I started testing the math on an HTML canvas and came up with this:
http://www.russellcottrell.com/blog/glassWrap.htm
It is very utilitarian (so far) but I believe it is accurate. You can select a file on your computer, then right-click and save the resulting image.
Actually, it is only accurate in the x direction; there should be a very slight curvature in the y direction, but it probably is not significant. Will look into it.
http://www.russellcottrell.com/blog/glassWrap.htm
It is very utilitarian (so far) but I believe it is accurate. You can select a file on your computer, then right-click and save the resulting image.
Actually, it is only accurate in the x direction; there should be a very slight curvature in the y direction, but it probably is not significant. Will look into it.
-
- Mitglied
- Posts: 1675
- Joined: Mon 23 Dec 2019 15:21
- Location: Ukraine
Re: Custom Distort for printing on non-flat media
Guess Distort Tool method suggested by Martin Huber produce sort of Linear transformation but not a true reversed cilindrical projection. So russellcottrell's method seems more realistic.
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
-
- Entwickler
- Posts: 4232
- Joined: Tue 19 Nov 2002 15:49
-
- Mitglied
- Posts: 254
- Joined: Sat 26 Jul 2014 10:13
- Location: California
-
- Mitglied
- Posts: 2293
- Joined: Sat 12 May 2012 21:38
Re: Custom Distort for printing on non-flat media
I would do this in a 3d App. Also because the shape on which the graphic is projected may not have a smooth surface and attempting to convincingly deform a decal along an uneven surface is a big hassle in my experience. Here is a quick Blender example:
You do not have the required permissions to view the files attached to this post.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait