Jump to content

Straight lines without borders


Recommended Posts

Hi!

I am trying to draw a straight black line in Affinity Photo 2 using the pen tool. However, no matter what I do and what settings I try, the software insists on adding a gray border to the sides of the line, so that it looks blurry (see attached image).

Can someone please explain how to fix this, so that the line looks normal?

line_02.png

Link to comment
Share on other sites

You can use the blend options for the drawn Pen line and adjust it via the "Coverage map" accordingly for the selected line curve layer ...

  1. Shows how to access the blend options for the line
  2. Shows the default behavior (what you actually see there in your tryouts for the line)
  3. Shows how to adjust the Coverage map accordingly (by dragging the left side of the diagonal line also to top, so it get's a straight line on top)

 

1)map0.jpg.7fccaebeaf9a986cf4eff558250f0b5c.jpg

2) map1.jpg.42c7ae6424600627f3c43e86dab1e827.jpg

3) map2.jpg.0fe1bce8108419cd644355e49d40f2a5.jpg

 

OR maybe even easier use and try the Antialising: "Force Off" setting ...

anti_force_off.jpg.8244a67959c4760c04ad75aee600e744.jpg

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

Welcome to the forums @fredrikonline

In addition to the advice above, it looks to me like you have used a stroke width of 4 pixels and the X coordinate is mid-pixel (not an integer) so the software is trying to draw two pixels – each side of the line – over three pixels, which is why you get the grey ‘border’ (because of antialiasing).

Photo always shows you the document at ‘document pixel resolution’ so, in this case, try moving the line so its centre is aligned to the grid to get two pixels either side of the line and therefore no ‘border’.

See attached image where the left-hand line is aligned to the grid but the right-hand line is not.

image.thumb.png.ada3bc67515ead20f72bed0bcaa3b7cd.png

Link to comment
Share on other sites

Thank you for your input @v_kyr. Unfortunately, dragging the left part of the diagonal line in “The coverage map” to the top does not seem to have any effect on the line and the unwanted edges (please see attached image).

I appreciate your input @GarryP. However, centering the image does not seem to solve the situation either, except that the software adds additional edges to the sides of the line in certain positions.

line_03.png

Link to comment
Share on other sites

2 hours ago, fredrikonline said:

I am trying to draw a straight black line in Affinity Photo 2 using the pen tool.

14 minutes ago, fredrikonline said:

However, centering the image does not seem to solve the situation either

You said you were trying to draw a straight black line, but you now mention centring the image.
Is that just a language translation issue or do you have an image of a line?
If you have an image of a line, how did you get that?

(I have a feeling that you might have rasterised something when you didn’t need to rasterise it.)

Can you show us a full-screen screen shot where we can see the ‘problem layer’ selected in the Layers Panel ?

Link to comment
Share on other sites

32 minutes ago, fredrikonline said:

Thank you for your input @v_kyr. Unfortunately, dragging the left part of the diagonal line in “The coverage map” to the top does not seem to have any effect on the line and the unwanted edges (please see attached image).

Strange, here's the common behavior I can deal with that and overcome with it under APh v1 ...

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

@GarryP Sorry, that was a mistake. I meant line, not image. Anyway, it seems that the unwanted gray sides of the line disappear at certain thicknesses of the line (when they end up on top of the line instead), so I guess I'll just have to choose a size where the side lines are not visible. I suppose this has to do with what you wrote earlier, although moving the line did not seem to have any effect.

@v_kyr Yes, that is strange. I don't get the same effect as you do in the video. Dragging the diagonal line in the Coverage Map does not affect the black line for me.

line_04.png

Link to comment
Share on other sites

I wonder what is the final intent of the document in question?
It’s just that I note you are zoomed in to 900% to see this "problem", which looks like an antialiasing issue.
What dose the line actually look like at it’s, for want of a better term, final intended use size?

macOS 12.7.6  15" Macbook Pro, 2017  |  4 Core i7 3.1GHz CPU  |  Radeon Pro 555 2GB GPU + Integrated Intel HD Graphics 630 1.536GB  |  16GB RAM  |  Wacom Intuos4 M

Link to comment
Share on other sites

If this is intended to be used on screen (web publishing for instance), you would be better to use pixels as unit for your stroke. Using points can result in partial pixels values, that Photos will render with antialiasing (unless it is set to off, as shown by @v_kyr). 

If it is to be printed, don't mind about that. It just appears on screen with APhoto. 

++++++++++

 

1 hour ago, fredrikonline said:

it seems that the unwanted gray sides of the line disappear at certain thicknesses of the line (when they end up on top of the line instead), so I guess I'll just have to choose a size where the side lines are not visible. I suppose this has to do with what you wrote earlier, although moving the line did not seem to have any effect.

If you use integer pixel values for the stroke and you place your line aligned on the pixel grid (i.e. position must be integer pixel value, not fractional), there will also be no antialiasing.  

— You can do this manually or set it in the Magnetism settings: 

https://affinity.help/photo2/fr.lproj/pages/DesignAids/snapping.html

https://affinity.help/photo2/fr.lproj/pages/DesignAids/pixelAlign.html

 

5 hours ago, fredrikonline said:

it looks blurry

=

4 hours ago, GarryP said:

[…] the software is trying to draw two pixels – each side of the line – over three pixels, which is why you get the grey ‘border’ (because of antialiasing).

Photo always shows you the document at ‘document pixel resolution’ so, in this case, try moving the line so its centre is aligned to the [pixel] grid to get two pixels either side of the line and therefore no ‘border’.

 

;) 

Affinity Suite 2.5 – Monterey 12.7.5 – MacBookPro 14" 2021 M1 Pro 16Go/1To

I apologise for any approximations in my English. It is not my mother tongue.

Link to comment
Share on other sites

@fredrikonline I see that your document unit of measure (UOM) is centimetres (see top-left corner of the rulers).

I can’t see the position of the line which is selected because you have the Node Tool selected but, if the X position of the line or the Stroke width is also specified in centimetres, then that could be a cause of the problem.

Your document will have a dots per inch (DPI) setting which is measured in inches, which tell the software how many pixels there are in each inch. If you are measuring things in centimetres then it’s unlikely that you will have chosen a centimetre size which translates to an integer pixel size – inches and centimetres have very few ‘common factors’.

Try changing the document UOM to pixels (right-click the UOM on the ruler corner – where it currently says “cm” – and choose “Pixels”), then check the X value of the line in the Transform Panel, when you have the line selected, to make sure that it is an integer number of pixels and also check to see if the Stroke width is an integer number of pixels.

The bottom line here is that, if you want to be ‘pixel-perfect’ then you need to use a document UOM of pixels and make sure that, for lines at least, you are specifying X/Y positions by integer pixel values and have a stroke width of an integer pixel value, otherwise antialiasing will probably occur (unless you have done some other things, some of which have already been mentioned).

To sum-up:

  1. Change the UOM to pixels;
  2. Select the layer with the Move Tool;
  3. Check the X/Y positions of the line are integer pixel values;
  4. Check the Stroke width is an integer pixel value.
Link to comment
Share on other sites

@GarryP@Oufti Thank you for your input and detailed instructions. Changing the settings to pixels did not seem to have any effect on the unwanted gray borders. However, when I move the line slightly sideways, to an X position that is not an integer, the line looks solid, so this is obviously a matter of pixels just as you assumed. Please see the attached images.

line_05.png

line_06.png

Link to comment
Share on other sites

Thanks for the screenshots.

Note: When giving us a screenshot, please show us the whole of the application window, including the main Toolbar; we have more information that way.

When your line has an odd number of pixels, and the line is pixel-aligned (its centre is at a pixel boundary), the software is trying to draw a half-pixel on each side of the line (e.g. width of 5 pixels divided by 2 = 2.5 pixels each side). This is where the grey comes from as the software tries to draw something that only half-exists.

The same thing happens when you have an even number of pixels and the line is aligned to the centre of a pixel.

What you are seeing is normal for Photo, and you can see the same thing in Designer’s Pixel Mode.

Edited by GarryP
Added note.
Link to comment
Share on other sites

6 hours ago, fredrikonline said:

However, when I move the line slightly sideways, to an X position that is not an integer...

That works because you are moving it exactly by one half (0.5) of a pixel. If you moved it by say 0.4 px you would get the antialiasing effect.

All 3 1.10.8, & all 3 V2.5.5 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

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.