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

How do I draw a simple 1-pixel line??


Recommended Posts

Okay, I thought this would be easy to figure out, even without the ability to use the AP Help (which doesn't work), but alas, I can't figure out how to draw a simple, solid, 100% opaque 1-pixel line in Affinity Photo.

I tried the Pen tool, but it only allows me to set the width in points, which results in a semi-transparent line with anti-aliased edges. If I set the line to "1 pt" I get a relatively clean, 1-pixel line but it's semi-transparent. 

1533448199_ScreenShot2018-10-08at2_46_52PM.png.2935efe11a9358236122d61639074f8c.png

Not what I want! 

Can I set the line tool to pixels instead of points? I tried typing in "1 px" where it says "1 pt" but it just randomly changed it to "0.8 pt" when I hit Enter. Speaking of which, that interface is a bit messy. When I click inside a field there I see double of what was in that field, plus it's really hard to read due to the white text on light gray background.

1404192618_ScreenShot2018-10-08at2_45_47PM.png.0c36e911f6f5a4c300207be24369aa37.png

In Photoshop this is very easy, and I can set whether the line is drawn as a vector object, or as pixels, and I can set the line width in pixels or points. 

Am I not able to do something similar in Affinity Photo? How do I draw a simple, crisp, 100% opaque, 1-pixel straight line in Affinity Photo? 

Link to comment
Share on other sites

Use the pixel tool. Press "b".  Welcome back to CG, c. 1980.

iMac 27" Retina, c. 2015: OS X 10.11.5: 3.3 GHz I c-5: 32 Gb,  AMD Radeon R9 M290 2048 Mb

iPad 12.9" Retina, iOS 10, 512 Gb, Apple pencil

Huion WH1409 tablet

Link to comment
Share on other sites

1 minute ago, gdenby said:

Use the pixel tool. Press "b".  Welcome back to CG, c. 1980.

I want to draw a straight line, a bit hard to do with a single-pixel brush tool. And if the line is slanted, I'd like it to be anti-aliased (but not if it's a straight horizontal or vertical line). That's why a line drawing tool would work better, but I can't get what I want from the AP line tool. 

Link to comment
Share on other sites

7 minutes ago, JimmyJack said:

You can change the line units in Preferences > User Interface > untick "show lines in points":

To draw a pure 1 px line it has to have .5 grid placement value.

Thanks, I did look for a way to change the measurement type for lines, but couldn't find it before. 

I'm not sure what you mean by the .5 grid placement value, though. 

When I uncheck the "show lines in points" option, and then draw a straight 1-pixel line, it is still semi-transparent. 

356769601_ScreenShot2018-10-08at3_25_32PM.png.81ed1ecacf28df935ddac789be495e82.png

The layer it is being drawn on has Opacity set to 100%, and the line stroke is also 100% opacity. But I keep getting a semi-transparent line for some reason. 

I also have "Force Pixel Alignment" and "Move by Whole Pixels" and "Snapping" set on. 

Link to comment
Share on other sites

If you hold down shift, the pixel line will be constrained to vertical and horizontal while drawing.

iMac 27" Retina, c. 2015: OS X 10.11.5: 3.3 GHz I c-5: 32 Gb,  AMD Radeon R9 M290 2048 Mb

iPad 12.9" Retina, iOS 10, 512 Gb, Apple pencil

Huion WH1409 tablet

Link to comment
Share on other sites

2 hours ago, TomHu said:

I'm not sure what you mean by the .5 grid placement value, though. 

I also have "Force Pixel Alignment" and "Move by Whole Pixels" and "Snapping" set on. 

I'm talking about how/where the line is placed on the document.
See the attached. See how the pure black line is placed at 162.5. And the other semi transparent "double" (it's not, it's 1px) line, like you're getting, is centered on the whole number 165.

You can have Force pixel alignment on, you'll just have to type the final placement into the transform panel like I did.
Otherwise if you start off with pixel alignment and you're moving by whole pixels you'll never get to the .5 grid placement.
Once the line is at a .5 position, then move by whole pixels is your friend. Fun huh!? O.o:D

598699312_ScreenShot2018-10-08at6_35_53PM.png.c1ecb25ed38104a223b3449713278b24.png

Link to comment
Share on other sites

OMG, really? I have to transform every line by half a pixel just to get a single-pixel, 100% opaque line? 

:46_confounded:

I think I'm just going to finish this project in Photoshop, I'm really frustrated with Affinity Photo right now.

Thanks for your help.  

Link to comment
Share on other sites

8 hours ago, TomHu said:

to finish this project in Photoshop

But you will have to do the same in it. A 1px line must be placed exactly at 0.5 px.

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

9 hours ago, Pšenda said:

But you will have to do the same in it. A 1px line must be placed exactly at 0.5 px.

Not sure what you're talking about, I don't have to do any such thing in Photoshop. When I draw a single-pixel line in Photoshop, it isn't two pixels wide and semi-transparent as happens in Affinity Photo, requiring it be moved by half a pixel. 

Link to comment
Share on other sites

1 hour ago, TomHu said:

When I draw a single-pixel line in Photoshop, it isn't two pixels wide and semi-transparent

Then the line must be placed in a 0.5px position (I assume, that even in PS you are working with vector lines like the AP).
Alternatively provide a preview of how PS does, something like JimmyJack showed.

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

4 hours ago, Pšenda said:

Then the line must be placed in a 0.5px position (I assume, that even in PS you are working with vector lines like the AP).
Alternatively provide a preview of how PS does, something like JimmyJack showed.

All I do is select the line Shape tool, set it to pixels, make sure it's set to 1 px, then draw. I hold down the Shift key while drawing to keep the line perfectly horizontal or vertical. 

That's all I have to do in Photoshop. There's no screwing around with 1/2 pixels or anything like that. 

Here's a screen cap of me drawing two lines to show you how straightforward it is in Photoshop:

 
Link to comment
Share on other sites

Yes, this is one of those cases where anti-aliasing wreaks havoc with the result, and Affinity Photo does not have an option to automatically render all objects to the pixel grid automatically. Yes, there's Force Pixel Alignment, but a 1 pixel line will have to be placed exactly at 0.5 - which is a bit ridiculous to ask of the user.

Other design apps solve this with a simple document wide or even layer-specific pixel snapping that changes the rendered result on the fly. Not so in Photo, unfortunately. One of the many reasons why I think Affinity Photo is rather unsuitable for precise pixel work and pixel art. Another reason being the lack of a simple document-wide option to turn off anti-aliasing. And the Coverage Map work-around is a half-baked one.

[ On a side note, I found that it is often the simple basic things which require all sorts of convoluted hacks and work-arounds in Photo. That is why I mainly use it for HDR merging, stacking, and sometimes panoramas, and then export the result to continue work in other image editors. Of course, this is my personal experience, and a bit of a shame. Basic workflow foundations in Photo are quite shaky. ]

Link to comment
Share on other sites

7 hours ago, TomHu said:

select the line Shape tool, set it to pixels

But then it is not working with a vector like the AP. It is a specific tool that works directly with pixels. In AP, that works only with vector, it has to be substitute by setting the grid to 0.5 px, and then it works just as in the PS.

On 10/9/2018 at 12:57 AM, TomHu said:

I have to transform every line by half a pixel just to get a single-pixel,

If you have all the lines aligned to 1 px, you can all shift them by 0.5 px at a time.

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

As I understand it (which I admit could be totally wrong), the real problem is Affinity does not have a tool equivalent to the Photoshop Line tool. From what I have read, the PS tool is based on the rectangle tool, so pixel alignment works as it does because all the the edges of these rectangle-like shapes are pixel aligned, at least when they are perfectly horizontal or vertical so no aliasing occurs.

In this respect, they behave much like thin, un-stroked rectangle vector shapes in Affinity Designer. Obviously, this is much different than how the Affinity Pen tool works in line mode, so (I think) what is needed in Affinity to fix this is a separate line tool that works like the PS one.

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

Link to comment
Share on other sites

On 10/9/2018 at 4:46 PM, Medical Officer Bones said:

Other design apps solve this with a simple document wide or even layer-specific pixel snapping that changes the rendered result on the fly. Not so in Photo, unfortunately. One of the many reasons why I think Affinity Photo is rather unsuitable for precise pixel work and pixel art.

Yes, I'm discovering that using AP for web designs or online graphics where pixel precision is necessary is a very frustrating task. It's great for photo editing, but not for layouts. So unfortunately I've decided to stick with Photoshop for now until the AP team can address this limitation. I use Photoshop 80% of the time for web design or online graphics, and 20% for photo editing. So pixel precision is extremely important to me.  

Link to comment
Share on other sites

On 10/9/2018 at 11:54 PM, Pšenda said:

But then it is not working with a vector like the AP. It is a specific tool that works directly with pixels. In AP, that works only with vector, it has to be substitute by setting the grid to 0.5 px, and then it works just as in the PS.

If you have all the lines aligned to 1 px, you can all shift them by 0.5 px at a time.

I can also draw a vector line in Photoshop and get the exact same results... 

 

See how easy that was? Photoshop has the "Align Edges" option that assures vectors with straight edges are perfectly aligned to the pixel. I thought AP's "Force pixel alignment" and "Move by whole pixels" settings would work the same way, but apparently they don't. In fact, I have no idea what these settings actually do in Affinity Photo. I think they only work with pixel tools like brushes, not vectors or shapes. 

325167139_ScreenShot2018-10-11at1_12_30PM.png.fa8b83bbea9c70ed4796d5e2e76b69a6.png

Also note that I am still using Photoshop CS6, which is now 18 years old. The ability to snap the edges of vector shapes to pixel borders isn't a new concept by any means.

Link to comment
Share on other sites

1 hour ago, Fixx said:

Photoshop CS6 was released in May 2012, somewhat less that 18 years ago..

6 years, 5 months, 5 days to be approximately exact :D

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

4 hours ago, Medical Officer Bones said:

It is an awkward and convoluted process in Photo to work pixel-precise this way.

Is it easier in Designer? If so, perhaps the answer is that the OP is using the wrong Affinity application.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

52 minutes ago, walt.farrell said:

Is it easier in Designer? If so, perhaps the answer is that the OP is using the wrong Affinity application.

I'm not seeing much of any difference when using the pixel brush. In Designer, 1 px high rectangle will appear in pixel view w. antialiasing if it is not aligned to a whole pixel.

iMac 27" Retina, c. 2015: OS X 10.11.5: 3.3 GHz I c-5: 32 Gb,  AMD Radeon R9 M290 2048 Mb

iPad 12.9" Retina, iOS 10, 512 Gb, Apple pencil

Huion WH1409 tablet

Link to comment
Share on other sites

:34_rolling_eyes: Yes, I got the length of time that CS6 has been out wrong, sue me. I've been using Photoshop for 25 years, since version 2.0 (yes, go ahead and look it up).

The point is that Photoshop has had the ability to draw pixel-perfect shapes on a pixel grid for many years, this isn't something new or radical. 

Telling me I have to draw my lines then shift them all 1/2 a pixel to get clean, sharp lines in AP is absurd.

If I'm designing bitmap graphics using a bitmap program, when I draw a single-pixel line I expect to get a single-pixel line, not a two-pixel, partially transparent line. Is that really asking too much from a program designed to create bitmap graphics? 

Link to comment
Share on other sites

1 hour ago, TomHu said:

too much from a program designed to create bitmap graphics? 

Personally, I don't think it is a program designed to create bitmap graphics.

To me it is an image editing program, not a painting program. In fact it is advertised as "Professional image editing software" not "Professional painting software". A lot of Photoshop stuff has been added year by year so they could charge you for an annual upgrade fee, which Serif don't do. 

 

 

Windows PCs. Photo and Designer, latest non-beta versions.

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.