Built a site for rendering emblems...

Built a site for rendering emblems...

in API Development

Posted by: fooey.5824

fooey.5824

Here’s the site: http://guilds.gw2w2w.com/

And a couple examples:
http://guilds.gw2w2w.com/guilds/Spirit-Of-Faith
http://guilds.gw2w2w.com/guilds/Spirit-Of-Faith/256.svg

Basically I was working on rendering the emblems server side for a rewrite I’m working on, and this seemed like it could be a useful thing to pull out into it’s own site

It’s super super super simple and not user friendly, but I wanted to get it out to there to see if there’s any interest, and if anyone has ideas on things to add.

One thing I want to look at is rendering the svg’s as png too, but I’m running this on Heroku’s free tier, so there’s isn’t much space to work with.

Built a site for rendering emblems...

in API Development

Posted by: Goddchen.4958

Goddchen.4958

“An error occurred in the application and your page could not be served. Please try again in a few moments.” Over quota or something?

Built a site for rendering emblems...

in API Development

Posted by: fooey.5824

fooey.5824

“An error occurred in the application and your page could not be served. Please try again in a few moments.” Over quota or something?

yeah, got more traffic than I expected, and it probably wasn’t ready for public consumption

Built a site for rendering emblems...

in API Development

Posted by: smiley.1438

smiley.1438

(edited by smiley.1438)

Built a site for rendering emblems...

in API Development

Posted by: fooey.5824

fooey.5824

I’ll have to see what I can do about the colors, the emblem rendering is based on https://github.com/mtodor/gw2emblem, and he uses a hardcoded color list. I’ll see if I get better results pulling from the api directly

Built a site for rendering emblems...

in API Development

Posted by: smiley.1438

smiley.1438

You’ll need also to recalculate the color base depending on the background color, see here:

https://github.com/codemasher/gw2api-tools/blob/master/inc/color.inc.php#L117

The script calculates the color base for every pixel. Since SVG paths/elements can only have gradients or uni colors, you can possibly shrink that down and pick only 2 or 3 colors as base and do the calculation on these.

this is my emblem script: https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2emblems.php

(edited by smiley.1438)