arenanet / api-cdi

Collaborative Development Initiative for Public APIs
253 stars 41 forks source link

v2/specializations icons image quality #76

Closed KelianB closed 8 years ago

KelianB commented 9 years ago

I don't know what's up with that, but the icons for specializations don't look very good.

In-game screenshot sample: http://i.imgur.com/r7Eepsa.png Icon from the API: https://render.guildwars2.com/file/F8A95D6D3904A1F6430CF2D33A02FDF2A6132037/1011997.png

Edit: there is also a silly 5-pixels gap on the left and right of the images, maybe something can be done about that too?

darthmaim commented 9 years ago

For easier comparison:

Screenshot API
image image
dr-ishmael commented 9 years ago

The specializations panel in-game looks like it uses an overlay on the background image - so that's the full background image showing through with a bit of a border applied.

The icon, as referenced by the API, is what's shown in the drop-down list where you change the selected specialization.

KelianB commented 9 years ago

Oh yea, that makes sense! Then I think it would be really cool if we could have the background image for specializations.

lye commented 9 years ago

I can add in the backgrounds, but they're a bit wonky --

1784571

KelianB commented 9 years ago

If all of the backgrounds have this exact same issue, it's pretty easy to handle on our side. It would be better than nothing I guess.

lye commented 9 years ago

They mostly have the same issue. Pretty sure the padding dimensions are all the same, but the rgba of the padding varies. Shouldn't be a big deal.

I need to do a live deploy today to correct some discovered issues in /v2/traits-beta, so this change will probably go out today too <3

lye commented 9 years ago

Backgrounds are up. They're a bit weird; the game renders them by upscaling the image to 1024x256px, then cropping it to the lower-left 647x136px. I should probably put that in the endpoint docs. Here's an example rendering in my terrible javascript:

https://jsfiddle.net/o1oavwsa/

Some of them look kind of gross, but @tivac assures me that the browser image scaling is just terrible. Those are what are displayed in-game, so I don't know if there's anything I can do about that :/

tivac commented 9 years ago

https://developer.mozilla.org/en/docs/Web/CSS/image-rendering

Not the complete answer (compatibility lolololol), but futzing w/ these values should definitely help.

darthmaim commented 9 years ago

I made a quick test resizing them on the server, which looks slightly better, but not much, even after playing quite a bit with different filters. Especially on my retina display all those upscaled images look horrible. But still better than nothing, thanks for the super quick fix! :heart:

lye commented 9 years ago

I don't even know how we're making it look this crisp in-game though:

spec-in-game

Here's what it looks like in-browser:

spec-in-browser

And with your server's resampling:

spec-resampled

qq

lye commented 9 years ago

So I pulled over an engine programmer and he pointed out that we may actually be returning the correct texture but the wrong mipmap level. It's kind of telling that the bad backgrounds are exactly half the resolution of the normal ones.

The game is definitely using a different bitmap than what the render endpoint is returning though, so the inconsistency is more than just an issue with the browser's resampling. Gonna see if I can figure out how to get the correct image out.

KelianB commented 9 years ago

To me, some of the backgrounds have a much better quality than others. Looking at your initial jsfiddle, warrior/guardian/thief/engineer/elementalist seem better than mesmer/necromancer/ranger.

Edit: actually, I just realized the image size is not the same.

lye commented 9 years ago

Yeah, there's some really horribly obscure bug in render.guildwars2.com that's causing it to return the first mip level of images that have embedded mipmaps.

darthmaim commented 9 years ago

Just had a quick look at this again, and it seems like the file ids are wrong? The API returns 1012057, which is the 512x128 version, the correct 1024x256 one would be 1012058 (notice how it seems to always be +1 the small one). Not sure if the really is a bug with render.guildwars2.com then, maybe it's just your code getting the wrong file id (but then again, I have no idea how its stored internally).

1012057 1012057
1012058 1012058
lye commented 9 years ago

Hilariously, this is partially fixed. Three of the mesmer specialization backgrounds are still broken, but the rest look like they're being returned full-res. I'll try to apply the fix again to the mesmer art and see if that finally sticks.

lye commented 8 years ago

Pretty sure these are all fixed.

darthmaim commented 8 years ago

I was hoping your fix for this would also fix some of the item icons that are returned in lower resolutions (like 222822.png of Experience Scroll). Could you maybe take a quick look if this is somehow related and could be fixed the same way?