- Moving images on the screen in Android
- 6 Best Android Photo Editing Apps to Change Image Backgrounds
- Namrata Gogoi
- 1. PicsArt
- 2. Snapseed
- 3. Fabby
- 4. Cut Cut
- 5. PhotoCut
- 6. MagiCut
- Snip Them Away
- Read Next
- 5 Best Android Apps to Change Background of Photo to White
- Top 7 Unique Collage Maker Apps For Android
- Top 6 Android Apps To Draw On Pictures
- How to Watermark Photos Using Snapseed on Android and iOS
- How to Edit and Change Background in PicsArt for Android
- Fotor: A Fresh, Picture-Perfect Online Photo Editor That Offers Unique Effects
- Top 7 Must-Have Apps for Samsung Galaxy S20/S20+ and S20 Ultra
- Snapseed vs PicsArt: Comparison of the Best Android Photo Editors
- Did You Know
Moving images on the screen in Android
Moving various objects is often used in mobile games and various multimedia applications. In this article, we will look at how to add images to the screen and move them freely.
To do this, we need to perform the following steps:
- Create layout with the FrameLayout component.
- Create an ImageView programmatically for the added image and set it to OnTouchListener
- Define user actions in the onTouch() method
- Change LayoutParams values according to the current ImageView location
First, create a new project with empty activity.
In the activity_main.xml layout, delete the old layout and replace it with the new one. In this case, FrameLayout will be used as a container for added images.
Define the created layout elements in the MainActivity code.
To select and crop added images, we use the uCrop library, which can be found on GitHub. Implement it by adding the following lines to the project’s build.gradle file:
Then, in the build.gradle file of the app module, you need to implement the library itself:
After that, you need to register library activity in the AndroidManifest.xml of the application.
Now you need to get images to add to the application. With the help of intent, we call the file manager, with which we find the appropriate images on the device. To do this, set up button click handler as follows.
To get the Uri of the selected file, you need to override the onActivityResult() method in the activity code, adding the following code to it:
The getFileName() method is used to get the file name from Uri, you can see it in the source code of the project later.
When we have the Uri of the selected file, we can use the uCrop library to crop the image as we need. This can be done using the following lines in the startCrop() method.
After calling start(), library activity will open in which you can work with the image. As soon as the work is finished, the intent with the Uri of the cropped image will return to our activity. In this case, it will be easier for us to access the file itself, since its path and name are known. You can get it all in the same onActivityResult() as follows.
Here we immediately create a new ImageView, to which we set the size and load the Bitmap obtained from the file into it.
Now images are simply added to the screen and you can’t interact with them in any way. To handle touches for images, we add the OnTouchListener variable to the activity code, in which the onTouch() method will be overrided. This method allows you to catch various touches and gestures, but we only need the following user actions:
- User touched image;
- The user moves a finger across the screen;
- The user removed his finger from the screen;
Thus, the processing code will look like this:
Here we determine the current coordinates of the image when the user touches it, then calculate the change in coordinates and update them in the image when the user removes a finger from the image. There is also a condition due to which the image should not go beyond the screen.
Now all that remains is to set this touch handler for the created ImageView in createImageView().
That’s all. Now, by launching the application, we can freely move images around the screen.
Thus, with a few lines of code, you can create a simple application for interacting with images on the screen.
You can view the source code of the application by clicking on the link to GitHub.
Источник
6 Best Android Photo Editing Apps to Change Image Backgrounds
Namrata Gogoi
28 Apr 2020
The photo buffs must already know that the background of an image is quite important as the subject. For example, the bokeh of a portrait isn’t impressive if it’s not taken against a contrasting setting. When it comes to scenic frames, the foreground is usually ignored. Those are the best-case scenarios. What happens in worst-case scenarios? Perhaps, your pose is spot-on, but the backdrop is dirty? Well, there are plenty of photo editing apps that let you tweak and change image backgrounds in a jiffy.
Trust me; I am not joking.
These last few years have seen plenty of advancements in the field of image editing. From automatic image recognition to smart filters and effects, there is a lot to dabble with. What makes these photo editors special is that the implementation is spot-on.
So, if you are in the market looking for cool photo editing apps to change image backgrounds, here are some of our recommendations.
Also on Guiding Tech
VSCO vs Snapseed: Choosing a Pro Photo Editor
1. PicsArt
PicsArt is one of the best editing apps that lets you change image backgrounds. And that’s not the end of the story. It also lets you craft cute stickers from your images.
One of the best things I like about it is that it gives you three options to start with — Background, Person, and Hair. And based on your image, you have to pick either one of the above. After that, PicsArt will automatically separate the foreground from the background. Cool, right?
When it comes to the background images, the list is quite satisfactory. From cool patterned backgrounds to images of hills and beaches, it has them all.
You need to pick the right background. After all, you do not want it to seem like a cheap cut-paste job.
What makes it different from the other apps on this list is that it gives you nifty image blending options. You can tweak the shadow and the blur to make the image more realistic.
2. Snapseed
While Snapseed doesn’t have a ready-made feature to change image backgrounds, you can change the color of the background to light or dark through an assortment of tools like Selective and Brush.
Yep, it requires a tad more effort compared to PicsArt, since you will need to tweak the saturation and brightness manually. But if you ask me, this is one of the best methods if you are looking to tweak the image further.
For instance, if you want to dabble with Double Exposure, then Snapseed seems to be the best option for it.
3. Fabby
If you do not want to get in to the complexities of Snapseed and PicsArt, you might want to give Fabby a shot. Coming from the stables of Google, this nifty app automatically replaces the photo background with short, neat video clips. And it doesn’t end there.
There are plenty of filters and pop-art effects, and needless to say, it makes your photos and videos Instagram-ready.
At the same time, Fabby lets you blur the image background. The bokeh is smooth with neat edge detection.
However, there’s a catch. You can’t add pictures from your phone’s gallery. You have to capture the images on the go.
On the upside, there are no ads, and you’ll love the clutter-free and easy-to-understand interface.
The backgrounds are trippy, and the odds are that you will love them at first glance. I particularly like the one with the comic theme. What about you?
Also on Guiding Tech
Top 10 Free Photo-Editing Apps for Android
4. Cut Cut
Cut Cut not only lets you change the image background of photos but also gives you plenty of stock images to play with. From the white cottages of Santorini to the Taj Mahal, there’s a lot to explore. At the same time, you can also add images from your phone’s background or search online for some apt images.
Similar to PicsArt, Cut Cut also detects the outline of the subject automatically. The selection is quick and accurate. Once you know your way around the app, you will find it easy to replace backgrounds. Again the trick here is to find the right background for your images.
However, there are ads in the free version of Cut Cut, and if you have a handful of images to modify, this could be an issue in the long run. Cut Cut adds a watermark to the lower right side of images.
5. PhotoCut
The next app on our list is PhotoCut. While PhotoCut doesn’t have auto-selection features like Cut Cut. However, the manual process is quite simple and precise.
Once you have selected the picture, mark the border of the subject, and the app will select the relevant adjacent parts automatically. You have to continue this process until you are satisfied with the selection. While it may sound like a lot of manual work, but it isn’t.
Once you have made the selection, PhotoCut gives you the option of selecting a backdrop from your phone’s gallery or picking one from the pile of stock images.
Pixabay powers the stock images pile and the images are breathtaking.
Furthermore, you don’t have to scroll endlessly to find the image of your preference. There’s a search function at the top, which makes the job easy.
PhotoCut bundles several filters and effects using which you can tweak the image further.
6. MagiCut
Compared to the ones above, the features bouquet of MagiCut seems to be a little limited, but if you have a couple of minor jobs, this app makes for a good pick. For instance, there’s no automatic selection for objects. However, on the bright side, there’s one for portraits.
Secondly, you can’t see the changes in real-time.
Like its counterparts above, MagiCut also gives you quite a few background options. Yep, starry skies to the blue water of oceans (see HD wallpapers of nature), you get them all.
Plus, there’s the option to pick images from Pixabay. However, it’s a premium feature.
Also on Guiding Tech
# Android apps
Snip Them Away
So, that was how you can remove and replace backgrounds in photos. While PicsArt makes the job pretty simple, it doesn’t hurt to try the other Android apps as well.
Which one of these apps will you try?
Next up: How about online tools for removing background from photos? Read the following article to discover some of the best online tools to remove backgrounds from images.
Last updated on 29 Apr, 2020
The above article may contain affiliate links which help support Guiding Tech. However, it does not affect our editorial integrity. The content remains unbiased and authentic.
Read Next
5 Best Android Apps to Change Background of Photo to White
Keep the focus on your image by removing the background from it. Check out the best # Android apps to change the background color of a picture to white.
Top 7 Unique Collage Maker Apps For Android
Are you a looking to create unique photo collages? Check our list of 7 amazing collage maker apps for # Android.
Top 6 Android Apps To Draw On Pictures
Love doodling on photos? We help you draw like a pro with these # Android apps.
How to Watermark Photos Using Snapseed on Android and iOS
Looking to add watermarks through # Snapseed? We have found a nifty workaround to stamp your watermark on images using Snapseed.
How to Edit and Change Background in PicsArt for Android
Want to remove messy background from a photo? Here’s how to change and modify the Image background in # PicsArt for # Android.
Fotor: A Fresh, Picture-Perfect Online Photo Editor That Offers Unique Effects
Fotor is a new and fresh online photo editor that offers some new and unique effects. Try it out now!
Top 7 Must-Have Apps for Samsung Galaxy S20/S20+ and S20 Ultra
Boost the potential of your # Samsung Galaxy S20 and S20+ with these powerful # Android apps that we have compiled.
Snapseed vs PicsArt: Comparison of the Best Android Photo Editors
In a switch between # Snapseed and PicsArt? Read our detailed # comparison of the two most popular # Android photo editors and see which app is suited best for you!
Did You Know
Rhein II is one of the most expensive photographs in the world.
Источник