Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1

    Default Pixel level alignment of elements for exporting?

    When I've exported various diagrams to PNG or BMP files, I occasionally notice that edge lines (and sometimes text) will have a hint of heaviness or lightness.

    I've convinced myself that it's due to the fact that many elements are not exactly on pixel boundaries and Xara must, therefore, interpolate to the "grid" of the resolution of the requested target format. Aligning elements to exact x,y origins (instead of tenths of a pixel) seems to eliminate the effect. (Or at least it makes all the interpolations use the same basis.)

    Is my conclusion valid?

    Is there a method to "snap to pixel", so that the alignment every single element doesn't have to be edited
    .

    I've attached an example of the kind of element that I'm working with. The box has its x,y origin. And the text has its own x,y origin. They almost never fall naturally on pixel boundaries.

    Thanks in advance for any advice.

    Click image for larger version. 

Name:	Pixel Alignment.PNG 
Views:	104 
Size:	1.4 KB 
ID:	115630Click image for larger version. 

Name:	Comment Box.PNG 
Views:	108 
Size:	4.7 KB 
ID:	115631

  2. #2
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,918

    Default Re: Pixel level alignment of elements for exporting?

    Hi Contours,

    Despite many members recommending whole pixel placement I've never seen evidence that this is required. Provided you export as whole pixel width & height the bitmap looks perfect to me, regardless of fracton of pixel X & Y value placement.
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  3. #3

    Default Re: Pixel level alignment of elements for exporting?

    I've never seen evidence that this is required.
    To clarify what I'm asking, I worked up the attached capture of an exported PNG (that, unfortunately, is converted to a compressed JPG by the forum).

    The text string in the second box is offset 0.3 pixels, vertically and horizontally, from the text in the first box, which is origined on whole x,y coordinates. (The boxes, themselves, are both on whole x,y coordinates.)

    Looking closely at the t's, for example, shows the kind of effects I've seen. This is a minor example that requires a 2x magnification to see clearly. For other situations involving straight edge lines, the effect can be more pronounced.

    Click image for larger version. 

Name:	Box Compare.jpg 
Views:	109 
Size:	43.8 KB 
ID:	115637

  4. #4
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,918

    Default Re: Pixel level alignment of elements for exporting?

    I still can't see how you can avoid this Contour, unless you use pixel fonts, which are deliberately designed to fit into whole pixel spaces. For example, it doesn't really matter if the text is on whole pixel positions, this is just the origin point. See the attached xar which I hope explains this issue. As a matter of interest, a few years back it was recommended that the text was cloned, getting two exact overlapping text areas which created better text on bitmapped buttons etc. I don't think this will make any difference with todays situation.

    Flash used to include pixel Fonts to allow for pixel perfect positioning.

    EDIT: By the way, the forum is quite happy with png's so I don't know why yours was changed to jpg.
    Attached Files Attached Files
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  5. #5
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,830

    Default Re: Pixel level alignment of elements for exporting?

    You might have a play with the PNG export settings - Bitmap Size > Anti-aliasing.

    Also try exporting at 600 dpi or even higher.

    The other thing that might clean things up is converting the text to editable shapes.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  6. #6

    Default Re: Pixel level alignment of elements for exporting?

    As further confirmation of the problem, I changed the text to a thin font and exported with both choices of the antialiasing methods. I've attached both results. The heavy/light effect is very pronounced with thin text ... but I can't see a difference with the export method. Regarding the horizontal lines I added, Xara does seem to do a "closest fit", so they're the same. But I have seen the heavy/light effect when a line is part of a graphic.

    Regarding different fonts, I don't have a choice. What you're seeing in my example is Roboto Thin ... and I probably use 50 different ones. Yes, the problem could be lessened by exporting at a higher DPI. But where this whole situation came up was in exporting "screen-sized" graphics for display in other applications. Those applications aren't aware of the export setting and wouldn't know to downsize the image.

    At this point, my main question remains:
    Is there a method to "snap to pixel", so that the alignment every single element doesn't have to be edited?

    And it appears that the answer is "no". Until some other solution emerges, it looks like manual alignment is the only solution for precision results.

    Thanks for the responses.

    Click image for larger version. 

Name:	Normal PNG Export.jpg 
Views:	95 
Size:	36.7 KB 
ID:	115646Click image for larger version. 

Name:	Export with screen antiA.jpg 
Views:	104 
Size:	36.3 KB 
ID:	115647

  7. #7

    Default Re: Pixel level alignment of elements for exporting?

    Fonts seldom are ever pixel dimensions. For lines, they do need to be whole pixel dimensions and likely need to be on a pixel grid--and/or whole X/Y pixel dimensions from the edge of the background.

    What does your export look like if viewed at 100% scale? What is the 100% size of the yellow panel?

    Edit to add image. View at 100%.

    Click image for larger version. 

Name:	roboto.png 
Views:	104 
Size:	10.6 KB 
ID:	115653

  8. #8
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,918

    Default Re: Pixel level alignment of elements for exporting?

    Here is an example of a pixel grid. It has no need for anti-aliasing as the lines that make up the text lines is whole pixels as are the spaces between the characters. Unfortunately pixel text fonts tend to be pretty ugly especially in X & K etc.

    Is there a method to "snap to pixel", so that the alignment every single element doesn't have to be edited?

    And it appears that the answer is "no". Until some other solution emerges, it looks like manual alignment is the only solution for precision results.
    The answer is no, and even if it was possible to align every character to whole pixel X&Y positions, the height & width & gaps wouldn't be
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	pixel-font.png 
Views:	77 
Size:	677 Bytes 
ID:	115654  
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  9. #9
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,918

    Default Re: Pixel level alignment of elements for exporting?

    If you want to look at these pixel fonts here is a link:

    PIXEL FONTS
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  10. #10

    Default Re: Pixel level alignment of elements for exporting?

    [QUOTE[Regarding different fonts, I don't have a choice.[/QUOTE]

    I realize it's been somewhat vague as to exactly what I'm seeking, but let me state it this way:
    > when aligned on whole pixels, the same words from different areas of a graphic look precisely the same when exported.
    > when those same exported words aren't aligned, they look slightly different when exported.

    Roboto Thin is just a good example of the 99.9% of all fonts that show this effect in some way. (I've never seen the effect anywhere when things are pixel aligned.)

    Hence, my conclusions: 1) pixel alignment is necessary if you want to avoid these effects, and 2) it must be done manually.

    A solution would appear to be: have a macro setting of "Round x,y positions to whole pixel coordinates". But, likely, that would induce other effects.

    Thanks for the responses.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •