zmalltalker / sketch-android-assets

Generate Android assets in Sketch
GNU General Public License v3.0
356 stars 55 forks source link

Feature Request: Support JPG/WebP output #37

Open ghost opened 8 years ago

zmalltalker commented 8 years ago

Interesting idea. I'm assuming this is for the Android plugin? It looks like Sketch will gladly export jpg, but WebP does not seem to be supported out of the box. I don't know too much about jpg vs png, what would we gain by choosing jpg over png?

ghost commented 8 years ago

@zmalltalker Yeah, for the Android Export feature. We have a lot of full-screen images in our app, and the devs are constantly chastising me for sending them PNGs. For the sake of our sanity, I won't go into the differences in visual output but I think most experienced designers would agree that sometimes a JPG will do when the PNG blows out the downloadable package file size.

A few examples: a 360x640 photo: PNG: 369 KB JPG ("Quality" at 90%): 66 KB

The same image at 600x960: PNG: 860 KB JPG ("Quality" at 90%): 143 KB

Now consider the Nexus 6 at 2560 x 1440... PNG: 5 MB JPG ("Quality" at 90%): 840 KB. WebP: 221 KB

zmalltalker commented 8 years ago

Thanks for the explanation, @imvunoah. As I mentioned before, implementing this is trivial. Supporting it as an option for the end user would probably require some kind of UI for selecting the file type for exporting. I'm a little reluctant to introducing yet another dialog (eg. a dropdown for selecting png or jpg), as this would slow down the interaction. We could implement this as a separate plugin, ie. a separate .jstalk file, but that seems unelegant.

Thoughts/ideas/suggestions?

ghost commented 8 years ago

I actually think the plugin could use more UI. I am always having to explain to my co-workers how do change the base density, which sometimes I admit I can't even figure out myself because it seems like the drop-down gets taken out of the UI.

Anyway, here is a quick wireframe for what I think is some simple UI you could implement to help beginning Android devs even understand what the hell base density is. :) Android Export.pdf

zmalltalker commented 8 years ago

Thanks for the wireframe, @imvunoah. I'm not much of a Cocoa programmer, but I think it's possible to use a custom NIB/XIB in a dialog which should work inside a plugin. If anyone feels like having a go at it, that would be very welcome.

ghost commented 8 years ago

@zmalltalker The wireframe is just me showing off my trade. Two drop-downs would be fine!

GeertWille commented 8 years ago

you can always trigger a binary that compiles the png's and jpg's to webp...

arteepa commented 8 years ago

+1, is it possible to choosing the output format (png/jpg/webp) on the Save As dialog? PNG as default, as it would suffice in most of the tasks.

amyliuu commented 8 years ago

+1 for jpg output! 👍