Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Self-Destructing Message Android App Sending Messages Adding a File to the Message: Part 2

PNG to JPG for less memory usage

in the previous tutorial I learned that those file were used to reduce image sizes a bit, but they're still pretty big, I want to be able to convert from .png to a .jpg file for less memory usage and for the app to be able to send the picture faster. Can someone guide me on how to do it or the best way to send a lighter image size to improve overall app speed?? Thanks :D

jason chan
jason chan
31,008 Points

you use adobe photoshop save for the web. You also need to change the resolution to smaller one to make it smaller.

A.J. Kandy
A.J. Kandy
Courses Plus Student 12,422 Points

JPEG and PNG image compression algorithms work differently, because they're designed for different kinds of images.

Use PNG for simple, flat-color images (with or without transparency) like icons or diagrams. As Jason mentioned, using Save for Web and tweaking the settings will help a lot.

JPEG was designed for photos, to preserve detail and colours.

If you try to save a detailed photo as a PNG, you'll often find you can't get it below 200k or so - whereas an optimized JPEG can take it down to double digits. Likewise, a simple SVG icon can be reduced to 3K when saved as a PNG with a reduced color palette.

I wrote something on Quora that details all that, if you'd like to know more about Photoshop, file types and color modes: http://qr.ae/f7gwx