John-B Posted March 30, 2019 Posted March 30, 2019 I'm having trouble drawing single-pixel, opaque, non-antialiased lines. I can't find a way to turn anti-aliasing off, and the lines are either more than one pixel wide or partially transparent. I'm only talking about horizontal and vertical lines. In the attached screen capture, the line on the far right is a curve with a 1-pixel white stroke on a dark gray background. The line is vertical, but you can see it is more than one pixel wide, and it's not white. The line on the far left is a filled pixel selection. It looks correct, a single pixel wide and opaque white, but if I move it (the line second from the left), its width and color changes. I need to create a single-pixel line that's not transparent and a known color, like the line second from the right imported as part of a Photoshop document. Quote
Mithferion Posted March 30, 2019 Posted March 30, 2019 It depends of the position of the line. A line made by the Pen Tool, for example, has two sides. If it's a single pixel wide, it will have half a pixel for one side and half a pixel for the other. For it to be a perfect straight line fitting in a pixel, you have to position the center of the line in the center of the pixel. Look at the screenshot: The upper line has been made position its beginning and its end at .5 value on the Y axis. The other one, at a round number/position in the canvas. Best regards! Quote Windows 10 and Windows 11 :: http://mithferion.deviantart.com/ Oxygen Icons :: GCP Icons :: iOS 11 Design Resources :: iOS App Icon Template :: Free Quality Fonts (Commercial Use) :: Public Domain Images How to do High Quality Art :: Mesh Warp / Distort Tool Considerations :: Select Same / Object - Suggestions :: Live Glassmorphism Effect
firstdefence Posted March 30, 2019 Posted March 30, 2019 "You'll never know what you can do until you get it up as high as you can go! I keep telling my missus this but all I get is daggers SrPx and Mithferion 2 Quote iMac 27" 2019 Sequoia 15.0 (24A335), iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9 (Please refrain from licking the screen while using this forum) Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions
R C-R Posted March 30, 2019 Posted March 30, 2019 2 hours ago, firstdefence said: I keep telling my missus this but all I get is daggers So do you mean she is averse to loggins to the danger zone? SrPx 1 Quote All 3 1.10.8, & all 3 V2.5.7 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7 All 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7
John-B Posted April 22, 2019 Author Posted April 22, 2019 On 3/30/2019 at 12:07 PM, Mithferion said: It depends of the position of the line. So it's not possible to draw a precise, single-pixel line in an arbitrary position? What about filling a one-pixel wide selection? Why does that also depend on position? Shouldn't a filled selection include all the pixels within the selection, and none outside, with the same color/transparency? It looks like it's doing antialiasing whether I want it to or not. Is it not possible to do precision, pixel-perfect drawing? Quote
Mithferion Posted April 22, 2019 Posted April 22, 2019 When you do this in Illustrator, it positions the line for you at half the pixel, so, it’s the same principle. Understanding pixels and vector is essential to understand this. Best regards! Quote Windows 10 and Windows 11 :: http://mithferion.deviantart.com/ Oxygen Icons :: GCP Icons :: iOS 11 Design Resources :: iOS App Icon Template :: Free Quality Fonts (Commercial Use) :: Public Domain Images How to do High Quality Art :: Mesh Warp / Distort Tool Considerations :: Select Same / Object - Suggestions :: Live Glassmorphism Effect
firstdefence Posted April 22, 2019 Posted April 22, 2019 A short gif to demo what Mithferion is talking about. Aammppaa 1 Quote iMac 27" 2019 Sequoia 15.0 (24A335), iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9 (Please refrain from licking the screen while using this forum) Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions
R C-R Posted April 22, 2019 Posted April 22, 2019 7 hours ago, John-B said: So it's not possible to draw a precise, single-pixel line in an arbitrary position? If by arbitrary position you mean a straight line at any arbitrary angle (not just those aligned to the horizontal or vertical axis), then no that is not possible, not even with Illustrator's Align to Pixel Grid options. 7 hours ago, John-B said: Shouldn't a filled selection include all the pixels within the selection, and none outside, with the same color/transparency? What kind of selection do you mean? Vector objects are not defined by how many whole or partial pixels they fill; instead they are defined by the geometry of a path, which could consist of any number of straight and/or curved segments. So for example, an elliptical or circular vector object has no straight line segments at all; a rounded rectangle could have any combination of straight & curved segments depending on the geometry of its corners; & a vector path can have a stroke that is not a constant width anywhere over its entire length. Vector objects can also be rotated to any arbitrary angle & their fills & strokes can have continuously variable color and/or transparent gradients. They can be masked or clipped by other vector objects, each defined by the geometry of its path, & whatever colors & transparencies it may have. Because they are not defined by how many pixels they fully or partially fill, you can't really select just some of their pixels or just some of the color, transparency, stroke or fill properties of those pixels like you can with pixel-based rasterized objects. BTW, much the same thing applies to text objects because their properties are also not defined strictly by how many pixels they fill. Quote All 3 1.10.8, & all 3 V2.5.7 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7 All 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7
John-B Posted April 23, 2019 Author Posted April 23, 2019 On 4/22/2019 at 5:43 AM, R C-R said: If by arbitrary position you mean a straight line at any arbitrary angle (not just those aligned to the horizontal or vertical axis), then no that is not possible, not even with Illustrator's Align to Pixel Grid options. What kind of selection do you mean? Vector objects are not defined by how many whole or partial pixels they fill; instead they are defined by the geometry of a path, which could consist of any number of straight and/or curved segments. So for example, an elliptical or circular vector object has no straight line segments at all; a rounded rectangle could have any combination of straight & curved segments depending on the geometry of its corners; & a vector path can have a stroke that is not a constant width anywhere over its entire length. Vector objects can also be rotated to any arbitrary angle & their fills & strokes can have continuously variable color and/or transparent gradients. They can be masked or clipped by other vector objects, each defined by the geometry of its path, & whatever colors & transparencies it may have. Because they are not defined by how many pixels they fully or partially fill, you can't really select just some of their pixels or just some of the color, transparency, stroke or fill properties of those pixels like you can with pixel-based rasterized objects. BTW, much the same thing applies to text objects because their properties are also not defined strictly by how many pixels they fill. By arbitrary position, I mean any location within the document, NOT any rotation. I'm talking about horizontal and vertical lines. By selection, I mean a selection made with a marquee tool in a pixel layer. (There is more than one way to draw a line.) In the attached image, I made a selection with the Column Marquee Tool, and filled it with white on a black background (left line). Then I made another column selection, filled it, then dragged it a few pixels to the right (other line). You can see in the screen capture that the second line is still selected, but it's gotten wider and darker, the filled area now extends past the "selected" pixels. So it looks like it's not possible to be precise with either vector or pixel objects. I understand why this is the case with vector objects, but a pixel is a pixel. A selected area of pixels should NOT change its appearance or size as it's dragged around the document. Quote
R C-R Posted April 23, 2019 Posted April 23, 2019 57 minutes ago, John-B said: In the attached image, I made a selection with the Column Marquee Tool, and filled it with white on a black background (left line). Then I made another column selection, filled it, then dragged it a few pixels to the right (other line). You can see in the screen capture that the second line is still selected, but it's gotten wider and darker, the filled area now extends past the "selected" pixels. If I understand what you want to do correctly, if you had enabled "Force Pixel Alignment" in the Snapping section of the main toolbar, dragging would have snapped the selection into whole pixel positions. (If the selection had not originally been pixel-aligned then it would have been necessary to disable "Move By Whole Pixels" but since the filled column selection is pixel-aligned that isn't necessary here.) That attached force pixel alignment example.afdesign includes the history so you can move the history slider back & forth to see what I did to get the pure white fills. Quote All 3 1.10.8, & all 3 V2.5.7 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7 All 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7
Recommended Posts
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.