Hacker News new | past | comments | ask | show | jobs | submit | AndrewStephens's comments login

I really like this writeup.

A shameless link to my own dithering web component, which uses Atkinson dithering which I think looks cool but cannot be done on a GPU.

https://sheep.horse/2023/1/improved_web_component_for_pixel-...


And lived on a flat planet.


That’s not a valid argument. There is no reason why people in Japan couldn’t start their workday at 03:00, or people in France at 22:00


And while people in London might start work at 21:00, folks in Oxford might start at 20:55 and folks in Norwich might start at 21:02.

Time zones aren't just so everyone on the planet can start work at 09:00 local time. They're also for snapping everyone in a region to a shared time, even if it's a little off from their solar time.

Check out the history of railway time for the birth of time zones: https://en.wikipedia.org/wiki/Railway_time


Travelling would be so much more annoying if we did it that way. Imagine constantly having to double check what the local time is for getting out of bed.


How would that be useful for humans? Machines should make life easier for humans, not vice versa. For humans, I don't see any benefit to having to use a universal timezone. Being able to talk about time in a relative manner without converting timezones is very useful. I don't want to check timezones whenever someone tells me that they had to stay up until midnight, or wake up at 4am lol.


Because it makes the lives of every single person harder to make lazy programmers jobs easier. That's the only reason to do that.


I think that’s fine if you always stay in one place. The adjustment for jet-lagged visitors may be more disruptive though.


You've just introduced timezones


It always cracks me up when people think they are proposing a simpler system by ignoring complexity. Is akin to people saying, "why don't we just change the start/end time of schools/businesses instead of changing the clock back?" As if getting companies to agree to when to make a change, and updating all of their documents/signage/etc. would somehow be easier than allowing them to continue to say "open at 8."

For this one, It really amuses me on how they think they would accomplish keeping someone's phone to alarm at the equivalent of 7am when they fly across a nation.

Granted, I still hold the silly view that we should probably change daylight savings time to be a 10 minute change of the clock every month. Up for six months, down for 6 months. Would effectively be trying to tie it to actual solar time, which is what we seem to care about. And would be trivial with modern devices. (Though, no, I don't hold that this will happen.)


Well i mean, why stop there. We could alter the time of every clock every day by milliseconds or seconds, to keep perfect track of the solar timing. Better yet we could just trash the clock all together and decide to care about the things that got done rather than the exact time spent on it. This is probably not sarcasm


If we could easily change the duration of a second, I'd see little argument for why we wouldn't do that. Some of these solutions are easier than others.

Amusingly, these difficulties aren't static, either. Easy to argue that before rail and modern time pieces, what you are talking about is exactly what happened when people were using solar clocks.


Your idea is a lot better than my plan. When I am king of the world, no business or transactions will be allowed to occur on Feb 29th. Instead, every 4th year there would be a nothing day, where nothing happens. So no systems would ever have to deal with leap days or 366 day years.


My bank opens at 9am. My pharmacy opens at 8am. The corner cafe opens at 7:30 but is completely closed on Wednesdays. This "complexity," if you want to call it that, requires very little cognitive load, and certainly doesn't require any standardized features to be added to every operating system and programming language standard library.


The complexity I was referencing was having all businesses change by exactly the same amount on a given day. Which happens relatively flawlessly twice a year in much of the world. Just having them be different times for different companies is a completely separate thing.


Yes, but that's still all the same ballpark. It's useful to know that 9am is in the morning for almost everyone. Yes, there are exceptions but they are still just that - exceptions. I'm not sure how useful it would be to add even more chaos.

And again, it's a weird inversion in the role of a machine. Machines should make life easier for us, not the opposite.


With the "system" proposed in the comment I replied to, at which time will those businesses open in New York? London? Delhi? Tokyo? And why at those times?

What about, say, Amsterdam and Stockholm?


Hey, no need to call me out specifically like that.


This is great - as a site owner I especially appreciated that you publish discovered backlinks. I discovered a few that I didn't know about thanks to your service.


I looked at the backlinks for a website of mine and none of them actually linked to my site, so I was very confused...


Hmm, can you share the domain name? Either here or email me? I can look into it. (Though it's most likely suffix-list related, there are some outstanding issues in that regard.)


I owe you an apology; I clicked on the ↗ icons, not realizing that those take me to the domain’s homepage instead of the specific URL containing the link. I have now checked them all and they do in fact link to the domain. (Which, for the record, is ktane.timwi.de, a repository of documents relating to a video game.)


I was also wondering how well it would look in stereo. My guess is it would still look strange (the "depth map" would also appear dithered) but the effect would be interesting to experiment with.


This is correct. Atkinson dithering looks cool (at least to my eyes) but is not the best choice for real time work. In particular, it cannot be implemented in a shader, although you can approximate it. But computers are fast enough that a CPU-bound algorithm can still work at interactive speeds. Not sure how well it would work in an editor though - in theory changing a single pixel at the top left of the image could cause a chain reaction that could force the whole image to be re-dithered.

I did an implementation of Atkinson dithering for a web component in case anyone is feeling the itch to dither like it is 1985.

Demo: https://sheep.horse/2023/1/improved_web_component_for_pixel-...

Source: https://github.com/andrewstephens75/as-dithered-image


> in theory changing a single pixel at the top left of the image could cause a chain reaction that could force the whole image to be re-dithered.

My thought is to store the error for each pixel in a separate channel. When a portion of the bitmap is "dirtied" you could start in the top left of the dirty rectangle, re-Atkinson until, once outside the dirty rect, you compute the same error as the existing error for a given pixel. At that point there would follow the same dither pattern and you can stop.

As you say, it's conceivable you would have to go to the very end of the document. If the error is an integer though I feel like you would hit a point where you can stop early. Maybe I am misunderstanding how error diffusion works or grossly misjudging how wild mismatched the before/after errors would be.


Neat idea, be curious to see it implemented! You can probably get away with just stopping at the bounds of the dirty area. Sure, the error would accumulate, but they'd be localized to a single pixel. I doubt it would be visible.

One issue I suspect you'll encounter is that redrawing a restricted area during movement will cause that area to flicker weirdly while the rest of the image stays relatively stable.


> in theory changing a single pixel at the top left of the image could cause a chain reaction that could force the whole image to be re-dithered.

For a paint program, I think it would be acceptable if painting with the brush never changed existing pixels, only pixels newly painted with the brush, and you'd apply dithering only to newly added pixels in the brush stroke as the mouse dragged. The fact that you might be able to kinda see the discontinuities at the edge of the brush feels like it would be a feature, not a bug -- that you can see the brush strokes.

The really interesting effect would come when you implemented a dodge or burn tool...


The trouble is that dithering works by smearing the error over an area of pixels in a way that your brain unsmears into something close to the original image. If you start manipulating some pixels but not nearby areas then you will get very visible artifacts.

Maybe that is OK if you are drawing straight lines and boxes but any kind of detail is going to be destroyed.


Well sure, that's why you work in grayscale and only dither in the end if you want to maximize quality and detail.

I'm talking about from an artistic perspective. The way you see the brush strokes in certain styles of painting, it would add character to see where two dithered areas of the same lightness had a slightly visible discontinuity. I think it could be a very cool artistic effect.


I love how easy it is to write shaders that operate on images in HTML. My skills in this area are mediocre but I love seeing how far people can take it. Even providing a simple approximation of a depth map can really make the results interesting.

Some years ago I did a similar project to smoothly crossfade (with "interesting effects") between images using some of the same techniques. My writeup (and a demo):

https://sheep.horse/2017/9/crossfading_photos_with_webgl_-_b...


The ZX81 was my first contact with a computer - my parents bought one home just before Christmas one year. I must have been 7.

Learning how to program with the excellent manual was the first time I gained knowledge that me parents didn't have and it felt magical to control what was happening on the TV.

Of course, the ZX81 (1k!) was incredibly limited but that little box changed my life.


Was the same for me, with a Commodore Vic 20 around about 1982/3. I noticed that although my dad was a competent electrician and had built radios and fixed TVs he always struggled with using the computer and stuff like programming the VCR. It's surprising how hard it is to keep up. I'm noticing the same with myself and my 9 year old playing Xbox. It's insane how quickly [interested] youngers pick up stuff.


> I'm noticing the same with myself and my 9 year old playing Xbox.

I like to joke that if the game requires a joystick with more than two buttons, I can't play it.


It's fun to try and keep up, we can still play together and have a laugh and he tolerates my pitiful skills. It's even more fun when he's at his mum's house and we can chat and play squads remotely.


Oh yes. My failures are always hilarious to my kids. I’m the human version of Peppa Pig’s dad.

Silly daddy.


> Provide RSS support, even if it's bad. Start by making one feed for one page. Then add markup to your site so feed readers can auto-detect it.

This is the most important point - your feed doesn't have to be a full-text, embedded content document. It's nice is if is, but just a simple feed that links to your posts is a good first start and allows people to subscribe.


This is a common problem with stylesheets based on tufte-css (an excellent project) which attempts to make things nice for mobile users but often makes the wrong assumption about screen geometry.

My blog had the same problem until I removed the css styles that triggered the font size.


Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: