Hacker News new | past | comments | ask | show | jobs | submit login

Anyone have information on the mathematics behind optical alignment?



I was thinking about this and to me it seems like it’s closer to the centre of mass. It doesn’t really help that that the article doesn’t describe how they centre the thing in the ‘mathematical’ version. For example is it the mid-point of the extents. I think even using the average horizontal position of the vertices would be closer to ‘optical centre’ and even more so if you took area into account by breaking the shape into triangles.


The ‘mathematical’ alignment is usually just considered "centered however the alignment button works in the software you're using" in design discussion. For most software that'd be bounding box based - the center of the rectangle the software draws around it.

Optically is more center of mass, but ideal more 'center of visual weight'. Larger things are 'heavier', darker/more contrasty things are 'heavier'. Rounded things should extend over an alignment line a bit, flat shapes butt up against it (e.g. in the letters lO the O extends over the baseline slightly compared to the l, to visually connect with the baseline more).

In general the way it works is you align with whatever software says and you look at it and say does it actually look aligned or need minor adjustment? Because the point is to look aligned rather than to be mathematically correctly aligned. Like our letters above, they look more visually on the same baseline when they're not, then when all the rounded base letters sit most 'correctly' on the line.


It's just mean instead of mode.

The author is suggesting you use the mean X value of all the pixels in the shape, instead of the mode x value.

I'm sure fancier image editing software does this, but your eyes are pretty good at it too because it's just dividing the surface area in half, or thinking about it as the "center of mass" as you put it: where could you attach a string to this shape such that it doesn't tip over one way or another?


Feels like the vertical line goes through the barycenter of the shape




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: