Remix.run Logo
abejfehr 3 days ago

That code from your post is fairly standard image load handling, but the notable part is this line:

self.apng_supported = ctx.getImageData(0, 0, 1, 1).data[3] === 0;

Unless I'm misunderstanding, it's basically a "neat trick", like using ~~ for rounding or a fast inverse square root.

Is the intent that everyone who makes use of that trick is supposed to link back to your blog?

Sephr 2 days ago | parent [-]

The notable part is the PNG file was copied exactly. He could have generated one himself.