Custom Distort for printing on non-flat media

Here everybody can post his problems with PhotoLine
maho
Mitglied
Beiträge: 94
Registriert: So 18 Mai 2003 02:02

Custom Distort for printing on non-flat media

Beitrag von maho »

Big picture: I'm using PhotoLine to make an image, to be "printed" (engraved) on a beer glass. Something like this:

Bild

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:
Bild

After:
Bild

Any suggestions?
Benutzeravatar
Hoogo
Betatester
Beiträge: 4021
Registriert: So 03 Jul 2005 13:35
Wohnort: Mülheim/Ruhr

Re: Custom Distort for printing on non-flat media

Beitrag von Hoogo »

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.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Custom Distort for printing on non-flat media

Beitrag von shijan »

There is a Effects -> Effect Filters -> Projection -> Preset: Cylinder
Is it creates perspective in the way you need?
Bild
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
maho
Mitglied
Beiträge: 94
Registriert: So 18 Mai 2003 02:02

Re: Custom Distort for printing on non-flat media

Beitrag von maho »

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.
Martin Huber
Entwickler
Entwickler
Beiträge: 4159
Registriert: Di 19 Nov 2002 15:49

Re: Custom Distort for printing on non-flat media

Beitrag von Martin Huber »

maho hat geschrieben: Sa 26 Nov 2022 18:35 I can't seem to find a way to transform in a non-linear fashion using the Distort tool.
You can non-linearly change the content of a layer by changing the helper points:
DistortTool.png
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
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Benutzeravatar
Hoogo
Betatester
Beiträge: 4021
Registriert: So 03 Jul 2005 13:35
Wohnort: Mülheim/Ruhr

Re: Custom Distort for printing on non-flat media

Beitrag von Hoogo »

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.
Distort.png
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Custom Distort for printing on non-flat media

Beitrag von shijan »

Yep, it is Distort Tool in Toolbox
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
maho
Mitglied
Beiträge: 94
Registriert: So 18 Mai 2003 02:02

Re: Custom Distort for printing on non-flat media

Beitrag von maho »

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.
Juan
Mitglied
Beiträge: 611
Registriert: Do 06 Okt 2011 08:08

Re: Custom Distort for printing on non-flat media

Beitrag von Juan »

maho hat geschrieben: Di 29 Nov 2022 04:41 Is the Distort Tool available as an Adjustment Layer as well? That would be very helpful.
Agree.
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Custom Distort for printing on non-flat media

Beitrag von shijan »

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:
Bild
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Benutzeravatar
russellcottrell
Mitglied
Beiträge: 251
Registriert: Sa 26 Jul 2014 10:13
Wohnort: California

Re: Custom Distort for printing on non-flat media

Beitrag von russellcottrell »

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.
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Custom Distort for printing on non-flat media

Beitrag von shijan »

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
Martin Huber
Entwickler
Entwickler
Beiträge: 4159
Registriert: Di 19 Nov 2002 15:49

Re: Custom Distort for printing on non-flat media

Beitrag von Martin Huber »

shijan hat geschrieben: So 04 Dez 2022 15:46 Guess Distort Tool method suggested by Martin Huber produce sort of Linear transformation but not a true reversed cilindrical projection.
It is a 3rd degree polynomial, and yes, it is not a true reversed cylindrical projection.
Benutzeravatar
russellcottrell
Mitglied
Beiträge: 251
Registriert: Sa 26 Jul 2014 10:13
Wohnort: California

Re: Custom Distort for printing on non-flat media

Beitrag von russellcottrell »

Benutzeravatar
Herbert123
Mitglied
Beiträge: 2140
Registriert: Sa 12 Mai 2012 21:38

Re: Custom Distort for printing on non-flat media

Beitrag von Herbert123 »

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:
muggy.jpg
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
/*---------------------------------------------*/
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