I want to change the size of an image taken by the camera say 600x800. I am successfully doing so and its working fine but I also want to change the byte size or you can say memory as well. Like the photo resizer app https://play.google.com/store/apps/details?id=com.xllusion.app.photoresizer&feature=search_result on google play. For example if I take a photo on this app and change the resolution to 600x800. It creating this resolution photo simply with 23kb(no quality compromise) where as original photo was of 600kb. Can somebody help???
Related
I have used the Commonsware-cwac library exactly like the demo app. After resizing the framelayout which the preview is contained in I achieve a squared preview that maintains correct ratio and preview size. However, after I capture I would like to get a a photo with the same size as the preview. Now, when I capture a new photo, the saved photo is much bigger due to the fact that it captures the original and non-squared preview.
How can the output photo capture the same as the preview and no more?
Option #1: You let the library save the image as it does today, then crop the image yourself
Option #2: You fork the library and add in some sort of cropping logic as part of ImageCleanupTask
I am writing a Android app which need to display some high quality picture(took from professional DSLR). The problem is it can't be display from gallery.
I choose a photo in Gallery first. The target picture is 2464*1632 JPEG, roughly 4.5M;
Then I just need to compress it to 800*600 and display it in imageview:
image.setImageBitmap(this.bmp);
Thing is that I have tested other image I downloaded form internet(really low quality), and it works without any problem. Can anybody tell me why it can't be displayed? I will be really appericiated
Large images are tricky to handle due to limited memory. You have several choices:
Use a WebView (this allows you to have pinch and zoom functionality to make use of those extra pixels
Decode the image down to the size of the display and then put it in an ImageView using BitmapOpts http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html and changing inSampleSize. It seems you may be having difficulty with that, so consider using createScaledBitmap which just needs the dest width and height.
Is it possible to programmatically take a picture in full/high resolution? I use the camera preview and surface with some custom overlay content. The problem is that the takePhoto function returns data only in preview size low resolutions.
Even if I check the getSupportedPictureSizes the resolutions that are listed are far from the 5Mpix that is the max supported resolution by the system camera. So the question is can I take a photo in max resolution and use custom camera preview or I have to call the system camera Intent to have a full res photo?
Yes you can, you should setPictureSize(), see https://github.com/alexcohn/JBcamera for example.
PS Thanks, Benjamin, for drawing my attention back to this question. if I understand correctly, the author was upset with the resolution of data array returned from IMAGE_CAPTURE intent. But this is only the thumbnail; the actual hi-rez imagis writn to file. You can find this Jpeg file and load it into your app, in onActivityResult()
By default I think it is set to a low resolution. To change this call MediaStore.EXTRA_OUTPUT in your intent. See here for more detail:
http://developer.android.com/reference/android/provider/MediaStore.html#ACTION_IMAGE_CAPTURE
Is it possible to take a thumbnail photo using the camera? I see methods like getJpegThumbnailQuality but I don't see anything for taking the actual thumbnail. I must do this using the Camera API and not using an Intent.
By any means, Camera itself will not directly produce a Bitmap of thumbnail size. Most devices have limited set of picture resolutions for camera. However you can create another scaled down bitmap from the picture camera provides you.
I've an app that places an effect on a bitmap from a camera shot. it works fine on my Galaxy portal but when trying the app on HTC Desire the jpeg image is small. How can i set the picture size that is ultimately displayed to the full size of the screen? On the Galaxy i've used BitmapFacory.Options sample size=1, this makes the image the same size as the one captured, but on different phones this doesn't work. thanks.
There is a difference between the capture size and the preview size (the screen size never changes that's device specific) so I am assuming you are talking about the capture size.
You can only select a capture size that is supported by the camera Selecting Supported Image Sizes so I suppose you could select the highest size that a camera supports, but if you want to normalize the size (make same on each camera) then you would have to scale the resulting image up or down dependent.
But I am wondering if this is what you are really after, or are you trying to place the image in a specific location (like the center of the captured image) and possibly scaling the overlaid image to a percentage of the captured image?