CharlieHess / slack-poker-bot

A bot that deals Texas Hold'em games in Slack
MIT License
1.66k stars 208 forks source link

Render images as png instead of jpeg? #44

Closed hubdotcom closed 8 years ago

hubdotcom commented 8 years ago

Improve quality and lower file size

stephenyeargin commented 8 years ago

Source files are in here if anyone gives this a spin. Not sure what the license is on the card images.

Imgur, the current rendering library, seems to prefer JPG because it renders at a lower file size? So the source files may be PNG, but it may still spit back a JPG.

hubdotcom commented 8 years ago

Most likely since the input are JPG's - converting a PNG will retain the artefacts introduced by the JPG and output a high file size - but combining graphical PNG's retains the low file size. I've tested with PNG's on the output and seems to work good.

Did you manually rename all those jpeg cards?

CharlieHess commented 8 years ago

I'd take a PR for this, so long as it passes tests.

hubdotcom commented 8 years ago

See https://github.com/CharlieHess/slack-poker-bot/pull/46

Resources still need generating in a png format for maximum efficiency

hubdotcom commented 8 years ago

It doesn't appear the function toBuffer is used in the app? https://github.com/CharlieHess/slack-poker-bot/search?utf8=%E2%9C%93&q=toBuffer

CharlieHess commented 8 years ago

Fixed in #48.