Android Question Compress Image

Douglas Farias

Expert
Licensed User
Longtime User
Hi all, have a way to compress image on b4a?
for exemple i have image with 1 mb + and i use compress image go to 200 kb 100 kb etc
like
http://compressjpeg.com/
 

KMatle

Expert
Licensed User
Longtime User
What is the source of these images?

Own source: I use a batch converter like XNView (Windows) to reduce the size to 640x480 or 800x600 with 80% quality. The results are very good.

Compressing JPGs (JPG IS a compressed format) is almost impossible Or not effective) without reducing the size.
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
hi klaus thx for u response.

but have this on b4a? i m making a app social based on images, and many devices have great cameras, 1 photo = 5 - 10 mb
its a problem to upload photo to server, have a way to compress the image in b4a? get the photo with 7 mb make this 200 300 kb
and send to server later compress ?
7 mb is a big internet problem *-*

images is jpg or png only 2
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
just resize the bitmap/canvas to what you prefer, it's part of the B4A core already.
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
yes i m using canvas but no much diference for example image 2000x2000 7mb with canvas 400x1000 go to 5 mb *-*
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
doesn't make sense, even a raw format like targa (TGA) would have that 400x1000 smaller than 5Mb.

show the code you're using.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
If the images represent the users, I think is better allow them to choose a picture from the gallery, inviting them to choose a maximum size decided by you.

You could use LoadBitmapSample after they took the photograph, but greatly reducing the size of the photo, the quality becomes poor.
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
the strange is with php i can compress a image with for example 7mb to 500kb and i dont see any diference
on b4a when u compress lost most quality and 7 mb go to 5.

i dont need load this image on the app, i m only open contenct chooser and user selectr a photo, later i make upload to server.
the only problem is the size 7mb per photo is slow *-*

i need fint a way to send with 500kb , 700kb and dont lost much quality
like this website http://compressjpeg.com/

7mb go to 500kb and dont lost quality o_O
 
Upvote 0
Top