There are 2 ways to reduce the size of a jpeg image.
- Reduce the size of the image. If you are displaying the image on a phone, you probably don't need an image that is 1280x1024. You will be able to get by with an image that is closer to the size of the screen resolution for the phone or tablet. (Assuming the user does not need to zoom in on the image.) You can use B4A's LoadBitmapSample to load a JPG file and resize it if it is larger than MaxWidth & MaxHeight.
LoadBitmapSample(Dir As String, FileName As String, MaxWidth As int, MaxHeight As int) As BitmapWrapper
- Increase the compression of the JPG by decreasing the quality of the image. This will cause a blurry picture if you compress the image too much. How much is too much? It depends on the image.
This link might help you to decide: http://www.ampsoft.net/webdesign-l/jpeg-compression.html
I'd recommend you download the image that you think is sharp, to your PC. Download IrfanView from
http://www.irfanview.com and install the program. Run IrfanView and open the image that looks sharp. From the main menu select Image > Information and take a look at the image's "Current Size", "Compression", "Resolution", "Current Colors", "Disk Size". These are the image settings you will want to try and achieve using B4A.
Now download the image that looks fuzzy and display it's information using IrfanView. See which of these image properties are considerably lower than your perfect image. It shouldn't be too hard to determine what is causing the poor image quality. Repeat the process on several more images just to be sure.
I hope this helps.