How to remove Unwanted Objects from Photo in Android - android

I am new in Android developing i want to build a photography app in which i want to remove an unwanted object or some part of image from Image .Is it possible if yes than how to implement it.Thanks in advance

It's not a yes or no question because it really depends on what you are trying to remove from the picture and what is going to be instead of that object in the picture
If it's just a few pixels you should be able to replace this pixels with the average of the pixels around the object but I get the feeling that this is not what you want.
You don't know what data is "under" the object therefore you can't cut out a part of a picture without either leaving a hole in the picture or making a smaller image that not include the object(assuming the object is in the edge on the picture and align perfectly with the width or height of the image)

Related

How to crop an image taking base a rectangle in android?

I'm implementing a custom camera, in the layout I have a rectangle inside the layout, where the user have to put his card, so after take the photo i need crop the picture, taking the reference the rectangle.
Any suggestion of how to do this?
Possibly you can use a library that do this on your behalf.
If you are not fully satisfied and need to understand how it works the process you can read the API. I do not know exact if you mean the selection have to be a rectangle of you are referring to the rectangle of your customer view where the card should fit, in the first case the library from Arthurhub should be enough
if you want to implement from scratch, I guess you need to use Matrix
enter link description here
https://github.com/ArthurHub/Android-Image-Cropper

Display image after image, as in layers to create a single image

Hi I am making a hangman, and I need to show image after image each time the player fails an attempt eg head first, then the body ect. I'm doing a layerdrawable but not how to scale it to the original image, how climb as I show the image and the images layer by layer to create the hangman?
I'd think the simplest way would be to decide what size your image is going to be. Then just use several PNG images with one body-part drawn on them and a clear background. As long as the images are all exactly over one another, you should see the familiar image of a stick figure drawn one part at a time.
Hope this helps.

Cropping large background image

I have two situations/projects where I have to use a large bitmap as background activity.
The first project ports a WP7 application to Android! The WP7 app is using a panorama control with a bitmap as large as 3 screens. I would like to reuse the large bitmap similar in a way that I use the left part for the first activity, the middle part for the second activity and the right part for the third activity. In other words I would like to define which part to crop.
In the second project we try to develop an app which should run on various screen sizes (including tablet), the app should also use a background image. Is it a good idea to provide only one picture with a quadratic size (as long as the largest screen width) and use this picture through every resolution and just crop the background image depending on the actual size of the display?
Is it possible to crop pictures on Android?
Is it possible to define the part of the picture which is kept?
Is it possible to use this croped pictures as background image or may I encounter performance penalties?
What do you think of this technique? Is it a good idea?
Thanks for your help!
answering your questions:
yes it is possible to crop pictures in Android (I've done so)
you can define wich part of the picture is shown in each activity
with a canvas and only drawing the rect that corresponds to the part
of the image that you want to display (eventough I wouldnt suggest
the approach of having diferent activities with the "same" content)
yes, you can use cropped pictures as background image for whatever
you want. Once you cropped the image use that bitmap and save it in
the device and then you might use it as you wish, and eventought is not recommended to have the whole image as background you can do so.
I suggest that you use a SurfaceView since you will be able to move it (the image) all around the screen without having to create a new activity. Here is a good tutorial to SurfaceView Playing with graphics in Android – Part I and this approach will also work with Tablets.

Android Photo Size and Resolution

Pardon the basic question, but I don't quite get how to work with Android Camera class and Parameters.
What I am trying to use Android API to take a picture that will display in a fixed area of my activity. Its about 3inches by 2inches on screen.
Lets say I know that I want a picture that displays in a 360x220px area? I am talking about on the activity size. So I how do I match this up to the accepted picture size of the camera. I mean I see it supports 480x800 and 800x480. This seems to actually be the closest size but its hard to find one thats really matches the display area I have?
So I don't know where to specify that size of picture to take that will look good in that area. Do I specify this during preview? I mean I guess what I thought I could do is preview in same size somehow as the display area I wanted to finally show the picture in? Also how to save it off properly. Should I just pick closest, save and then try to scale? Are there any libraries I should be using for this beside Android SDK?
Sorry about rant. I just have a specific size(I can change it somewhat but I have to fix it and I don't think its 480x800) and I just want to take a picture that will fit in that area, save it load and display it there? How do I do this? I would like a preview that does not take up a bigger area, and a picture that looks just like what is previewed.
Whats happening now is pictures displaying that looked zoomed etc or two small, too big everything but what I want to display.

How to find the co-ordinates of the transparent area of an .png image

In my application I use an image . I made some portion of the image transparent. Now How can I find the co-ordinates of the transparent portion of the image so that I am able to find the actual area of the non-transparent area.
I don't know the android SDK, but I doubt it has image manipulaiton built in. so using what ever language you are in, you need to open the image as data. Hopefully you can use an image library that will perform things like getting the size of the image. This will let you access the raw pixel data, which you can then check though till you find a pixel whos transparency is not equal to zero.
finding it in the rows is fairly easy, but the columns will take a bit more work. Remember that pixel data will be accessed as an array of length width * height in pixels.

Categories

Resources