Capture black and white photo from native Android Camera App - android

I have found good examples on how to call the native Android camera app using an intent, and I know you can set the app to take black and white photos using the UI, but I couldn't find a way to take a BW photo using the intent. Is there a way?

You might want to check on the Camera class that is provided in case you need more precise control over the way a picture is taken. If you're interested in color effects, there are some "pre-defined" color effects that can be found in the Camera.Parameters class. Hope you find your way now :-)

Related

Get the color of a pixel from camera intent

I am new with android studio and I have a question about camera.I have done the Take photo tutorial and now I have a button that opens my camera app. I want to take the color of a pixel from the camera app without saving the picture.
It is possible or I need to make camera API in order to take that color?
Any suggestion or tips about how I can make this project are welcomed.
Android camera intent either saves an image file, or it is cancelled. You need camera API approach to catch pixels without creating files. You can use a library like fotoapparat to wraps the tricky API for easy usage.

Camera: How to get image brightness while taking a picture?

I am making an application where the user has to be suggested about the quality of the picture he is about to take.
Like "Brightness is low" and "Your environment is dim".
To achieve this, we need to put an overlay message on the camera preview while the user is viewing the subject.
Does anyone have an idea on how could we take the image brightness from the camera preview by using sensors or some other way in live mode even before the picture is taken?
Any help would be appreciated.
Using the camera parameters as pointed out by #appleskin, would either of these methods help? setWhiteBalance() or setExposureCompensation().If you want to achieve this functionality at run time then use native NDK effect for brightness.you can easily got .so files from github just use according to your further requirement.

Customize the default Android Camera preview screen?

I am working on an Android app mainly based around the camera of the device. I am able to launch and use the Camera Intent but I would like to know if there is a way to customize this camera screen. I mean, for the moment, the camera preview screen displays all the settings of the camera, I would like to be able to hide them. If possible, I would also like to add new buttons on this screen, so I could launch popups or display a message to the user. Is it possible or should I try to use an external library which handles that ?
Basically, I would like to have a camera screen which would look like the one from the Snapchat Android app.
Thanks!
I would like to know if there is a way to customize this camera screen
No. After all, there are several hundred possible applications that you could be launching, and none of them have to offer any sort of API for the control that you want.
I would like to have a camera screen which would look like the one from the Snapchat Android app.
Then use the camera APIs directly (e.g., android.hardware.Camera) and write your own camera app.

Manipulating Camera Colors and Displaying it with Android Studios

I am currently working on an application in android studios that messes with the colors of live camera feed from a phones camera. For example, I may want to filter out all the reds, or maybe I want to make displayed camera image black-and-white.
However, I haven't really found much on how to do this. I've found tutorials on using both the deprecated Camera class and the android.hardware.camera2 class. My preferred sample code was for camera2, found directly here (takes you directly to Java class files, not whole project).
So does anyone know how to use camera2 to do what I want? Do I need to use the deprecated class Camera instead? My idea is that I need to have an activity that has the main job of displaying images, and behind the scenes the phone camera is running, sending the image (in whatever format, Bitmap) to have the colors messed with (by some code I will make), which then sends the image to be displayed in the main activity.
So that is three main pieces: (1) Camera to Bitmap, to get what is currently seen by the phone Camera and store it in code; (2) mess with the colors of the Bitmap to distort the current view in my desired way; and (3) then a way of taking the resulting distorted view and displaying that on the screen. Of course, as mentioned, it's the first and last of the three just mentioned that I really need help with.
Please let me know what other details will be helpful to know about.

How can I customize the frame size of the Android camera?

I am wondering whether it is possible to set the size of the Android camera's frame through the native camera app. The goal is to be able to take pictures of a certain format (where height == width). I have looked at the official documentation but it seems that the only parameter that can be passed to the intent (ACTION_IMAGE_CAPTURE) is EXTRA_OUTPUT to define the path in which the picture will be saved.
Any idea? (If it's not possible I guess I'll need to let the user crop the picture to make it fit in a given square).
Thanks!
You can customize it, as long as this is format offered by camera service. (See camera API)
But even this does not mean that desired resolution is actually supported. When you are using intent, you are invokinng installed camera appliaction - it may provide some ways of customisation via intent, but it is not defined in standart and not portable between different vendors.
Your best option is to post process image and crop it after it is taken

Categories

Resources