131 comments

[ 3.5 ms ] story [ 173 ms ] thread
That's amazing. What scaling algorithm does it use?
I don't think it's scaling. Go on the Zeus example and play with it. You'd be surprised. This is beautiful.
There's certainly more than just scaling involved, but there's definitely scaling in there.
I have the feeling is that the algorithm involves different pictures that superficially look the same but represent different things, and the code decides which picture to show according to the coordinates of the mouse, and them rescale it.

I tried briefly to read the code to see if I was right but failed so - I'm not good at reading other people's code :( - so someone please correct me if I'm wrong.

If you look at the "image" description files (e.g. http://essenmitsosse.de/pixel/scripts/zeus.px, linked by another comment), then it looks like the files define a set of constraints on the "components" in an image such as Zeus's arm , the bird beak, the cow's leg, etc. When the mouse moves, my guess is those constraints determine which components are rendered and where they appear on screen.
This is incredible stuff. Zeus in particular is amazing. It all seems to be done with weighted objects and a clever way of rendering them, but it's indistinguishable from magic from where I'm sitting.
It seems to be tying shapes and positions to aspect ratios and tweening them, but that would be an insultingly simple explanation. It's really an amazing piece of work.
The Zeus one is definitely tied to aspect ratio..
Every image is made of JS. It's multiple ways of rendering put into single files.

It's not an algorithm, it's just well-designed art. The design is entirely different for every image. But it's still very, very cool.

"Isn't all code well-designed art?" says my co-worker sitting next to me.
Changing the aspect ratio from portrait to landscape for many of them also results in really interesting interpretations of the same piece.
"Zeus" in particular is pretty cool in this regard
Awesome. I didn't really get it until I looked at the Brother picture, but that is brilliant.
Brother shows off a good use case.

Zeus is just fun

(comment deleted)
How are you seeing different pictures? I don't see any way to pick different images. On Windows+Chrome.
I'm seeing a grey menu bar on the right side. Also Windows+Chrome.
There's a gray sidebar on the right with a list of names and 2 arrows. If you click on any of the names, it goes to that picture.
Oh weird. It wasn't there before but now it is!
I don't see the navigation bar to navigate through the images with my browser in a portrait aspect ratio. Works fine in a landscape ratio though.
(comment deleted)
Reminds me of the following different project for content aware image resizing or retargeting:

https://www.youtube.com/watch?v=qadw0BRKeMk

https://en.wikipedia.org/wiki/Seam_carving

This is the kind of stuff I come to HN for! MORE OF THESE KINDS OF POSTS PLEASE!
Are you some kind of wizard? This may be the coolest tech demo I've seen all year.
I wonder if this could be extended beyond pixel art by rendering it with webgl.
It's rendering to a <canvas> so no reason why not...
This is amazing!

I really like that in "Teiresias", if you make the canvas narrow enough, the man jumping (presumably Teiresias) changes position and gets a white beard instead of white long hair. Just to still give the impression that it's an old sage, in small vertical space.

No, it's showing the sex change. He goes from long hair with breasts to losing his hair but getting a long beard.

"In Greek mythology, Tiresias... was a blind prophet of Apollo in Thebes, famous for clairvoyance and for being transformed into a woman for seven years."

The amazing part about the Tantalos slide was that its responsive implementation actually captured the ethos of the myth itself - no matter how far he reached, the fruit moved ever farther away. outstanding work.
I think there's a lot of thought that went into these. The "Teresias" one has the character's bald head and beard morphing into longer hair, I think suggesting that the gender changes as in the myth of Tiresias [1].

I think he (Marcus Blättermann) presented at a meetup in Berlin [2] in a talk called "Resolution-Independent Illustrations in Pure JavaScript". Does anyone have more information on how this was created?

[1] https://en.wikipedia.org/wiki/Tiresias

[2] http://up.front.ug/2016/03/08/meetup/

Would love to read some explanation on how this is made. Very impressive!
I encourage the author to do a write-up about the design of this. Fascinating.
Besides moving your mouse around, zooming in and out also works beautifully (might put a bit of a strain on your system though).

Given the sheer amount of work for one piece, with The Three Graeae appearing to be around 1000 lines of code, I'm also quite amazed he managed to produce seven. Brilliant, and Art indeed.

Zooming just decreases the resolution for me. I'm on Windows+Chrome. What does it do for you?
Zooming in decreases the resolution and zooming out increases the resolution for me on Windows 8.1 + up to date Chrome.
Very much the same (also as daodedickinson wrote), and I hope I didn't send you on a (short) wild-goose chase with this. I was pleasantly surprised to see that the author took resizing / zooming the window into account and I thought it gave some nice insight on how the features of the pixel art change with scale (without the canvas actually visually shrinking).
I like this. A little bug has snuck into the code somewhere: If you move your mouse pointer directly into a corner, the script fails with "Uncaught TypeError: Cannot read property '0' of undefined". I presume it is a division by zero when the image height or width becomes zero.
(comment deleted)
A likely related buglet, if you resize down to a single horizontal pixel line the pic gets stuck at one line.
This is really cool! If you look at the source, it appears that the images themselves are defined as JS code, almost like a vector image. For example, Zeus: http://essenmitsosse.de/pixel/scripts/zeus.px

The author then has a renderer to turn these into pixel data. It seems to render them down to an actual pixel image on the fly.

(comment deleted)
By the beard of Zeus! Bravo, loved this.
Zeus is the winner! ;)
This is absolutely nuts... extraordinary.
As others have stated, this is an amazing demo! I've played around in the past with designing responsive web comics with no real luck, but could you imagine creating a web comic using the techniques used in this demo?

The potential!

This is stellar.
It breaks if you position the mouse to the top or the left edge of the canvas.
same here (Chrome 48 on Win 10)
I'm a jaded, cynical, cranky, old curmudgeon. Still I say that was pretty flippin awesome. Especially Zeus!
Grab the lower right corner of the image frame and drag it.
Just realized on desktop you don't have to grab, sorry. On MOBILE devices, you can touch a corner and drag it.
So is this some kind of specialized constraint solver? I'm looking at the JS source for the various art and it seems to be defining relationships alongside the shapes and styles.
How do you get to the other images? Or is it broken on mobile (Android Chrome)