Author Topic: PanoJS  (Read 21316 times)

0 Members and 1 Guest are viewing this topic.

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
PanoJS
« on: December 02, 2011, 12:12:52 pm »
If you go here:

http://www.dimin.net/software/panojs/

...there's a Google Maps-esque zoomer script thing. Problem is, it's hard work finding the software to cut up the maps - the only Windowsy one on the list is Zoomify, which crashes on large maps. Has anyone else had any better results?

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 640
Re: PanoJS
« Reply #1 on: December 02, 2011, 12:55:19 pm »
With a little bit of work this could be made to work well with game maps.  It's a bit wasteful on maps with repeating tiles, and non-square maps, but that could easily be solved...  Would also be nice to have layer support.  There's also still the issue of not being able to save the map, but, I suppose you could always pass the viewer information to a server side script that would render the same view of the browser and send it back to the user.

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
Re: PanoJS
« Reply #2 on: December 02, 2011, 01:19:26 pm »
Aha, the "imgcnv" tool it mentions has a Windows version which seems to work, and doesn't square-ify the image. You need to edit the Javascript to make it use PNG files and then it works pretty well. I don't have a server handy to upload it to, but the 12752x8816 Castlevania: Aria of Sorrow map turns from one 11.8MB file to 2369 smaller files that add up to 14.7MB after a rather long PNGOUT session.

For the full image, it'd be easiest just to offer it as a separate download (at the cost of server space).

I think it'd be trivial to make it use JPG files for all the scaled down images and PNG for the end, which might make it use a little less space.
« Last Edit: December 02, 2011, 01:20:20 pm by Maxim »

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
Re: PanoJS
« Reply #3 on: December 02, 2011, 01:49:09 pm »
It was indeed trivial:

Code: [Select]
return "" + l + "_" + x + "_" + y + "." + (l==0 ? "png" : "jpg");
...and we're down to about 8.5MB for the images which isn't bad - the extra locality of tiles gets you more compression than the original PNG, even after you use some of that up for the JPGs. It'd still be nice to have it avoid duplicate tiles, though, but that might be tricky...
« Last Edit: December 02, 2011, 01:52:40 pm by Maxim »

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 640
Re: PanoJS
« Reply #4 on: December 02, 2011, 02:15:25 pm »
I was thinking hard or symbolic links, but that only half works since the request URI is going to technically be for a different file and the web server will probably serve it again.  So that leaves having to have some sort of tile map or index.

I'm considering looking at my map cruncher again.  It would mean having to write my own viewer or modding this one.  But I could also add in layer support, which would be cool for certain games.
« Last Edit: December 02, 2011, 02:41:33 pm by DarkWolf »

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
Re: PanoJS
« Reply #5 on: December 03, 2011, 03:05:46 pm »
For the duplicate tiles, you could use redirects which would avoid the need to resend the data but would need server-side support; or maybe a file that would remap the client-side requests for duplicate images to the same file (perhaps using colours in a PNG image for the matching, rather than something bloated like XML, but that'd require a newer browser). It's always nice if the result is just a bunch of files on a server.