Jump to content
You must now use your email address to sign in [click for more info] ×

Arcs or Arches: a macro to bend images


John Rostron

Recommended Posts

This is an updated version of the Polar Quadrant macro I have posted earlier. Consider a rectangular image that you would like to bend into an arc:

Before.png.77612b925e6ed938a9d0da5e811578b3.png

The macro has two parameters. The first (a or Sector Width) controls the fraction of a circle that the altered image will occupy. The default value of 1 produces an arc of one eighth of a circle. Reducing this to 0.5 gives one quarter of a circle. This image this parameter set to 0.5:

After1-1.6.png.6d2ed2b84a54f788987eaeb945e49973.png

The second parameter (b or Height below Top) controls the position of the centre of the circle. Setting this to 1 places the centre at the bottom edge of the image. Reducing the value places the centre above the bottom, thereby reducing the radius. The following image has this parameter set to 0.75 (and the first to 0.5):

After2-1.6.png.79aad47907bf9ea9bdf04ab616cedd1d.png

A few notes:

The parts of the final image outside the sector are transparent. The parts within the sector retain the original background colour.

The macro works with the latest 1.7 Beta (333).

I have tried to set both the default parameters to 1. However, in the 1.6 version, it insists on setting the default of the second parameter to zero which gives you a blank output! You will need to increase this second parameter. It seems to perform properly in the 1.7 beta.

The image layer is rasterized at the start of the macro.

If you apply a small value of the Height below Top parameter (below 0.5), You will get a partial (or even full) mirror image in the bottom part of the screen. I have left this, since some users might want to  utilise it. Otherwise you can crop the image.

The macro comprises a rasterization followed by Filter > Distort > Equations with the following lines for x and y:

x=w*atan((x-w/2)/(h*b-y))/(180/pi/a)+w/2
y=h*b-sqrt((x-w/2)^2+(h*b-y)^2)

Here are the macro and macro library (containing the one macro).

Arcs and Arches.afmacros

Polar Sector.afmacro

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.