Manipulating an image on App Engine - java

I'm trying to draw text to an image from Java in the Google App engine, but I've found no methods (since the java.awt.image.* isn't whitelisted) to do it with. I'm also trying to "layer" one image on top of another, which I can't figure out how to do.
Is there any way to draw text on an image or overlay one image over another in App Engine using Java? Has anyone found any other solutions to this?

You have to use Google's Images API instead.
Not sure if it can do all you need it to, but it does include image composition.

Related

Android App use HED with OpenCV and Deep Learning(Java)

I am developing an android app to scan documents with my phone. I am using openCV and Canny edge detection and it works ok but if I try to scan an document on a background without enough contrast between the document and the background it fails. I have tried other apps in the Play Store and they are still able to scan the document with less contrast. So I was looking for ways to improve my edge detection and found this:
https://www.pyimagesearch.com/2019/03/04/holistically-nested-edge-detection-with-opencv-and-deep-learning/
But I can't figure out how to use HED in my Android Studio Java project. More precisely I can't find out how to create the custom layer cropping class for the neural network in Java. I was able to get the rest of the tutorial to work but I dont know how to create the custom layer cropping class.
At the moment im am registering an empty or wrong class as cropping layer and I'm getting blank images.
If any of you guys know something or can point me in the right direction I'd be very thankfull.
(edit) I did some research and apparently you have to create a class in c++ and use it in java but i can't find instructions on how to achieve this.

How to create a video from a series of images with transition

I want to create a video from a series of images and add a transition between the images (e.g., fade in and fade out). I’m looking for a Java solution and not a C++ one (FFmpeg or anything else).
I checked out JCodec and MediaCodec, but none of those support image transitions.
Have you already tried it with OpenCV for Java? OpenCV offers almost everything you need for such a task. To the transitions you would have to worry about then manually with image blending. But that can be solved with OpenCV too. Just take a look at the documentary
EDIT:
It looks like the Java API lacks the appropriate module that can encode a sequence of images. You can fade images in any case. Take a look at the tutorial. This means you would have to crossfade the images with OpenCV and then use another API (e.g. jcodec) to make a video from the images you create.

Image dimensions for imageView

Okay so i have pictures on server. I would like to display them in my app as a part of a ListView row. I've already made that and now I have a question regarding the dimensions of the pictures. Since its a bad idea to save my image at 48dp sizes on server (36x36, 48x48, 72x72, 96x96 ..) and then download specific one for specific DPI device. Is it possible to only save a 96x96 and then set it to an ImageView. ImageView width and width = 48dp, and scaleType= fitCenter. Are there any better ways? please help me
You're right that you need only one image size on a remote server like 96px and then in Android app just fit it to your needs like 48px.
The easiest way to implement it would be using Picasso library.
Of course, there is a Glide, with many extra features, (so it might look at the beginnig a bit complicated for beginners), but for the most of uses Picasso is a enough solution.
You can also try a new library developed by Facebook, called Fresco,if you care also about memory using but I highly recommend you a Picasso.
Here you would find nice tutorial for this library:
https://futurestud.io/blog/picasso-image-resizing-scaling-and-fit
If you would find more information about these three libraries visit this site
Fragmented Podcast - 005 – Image libraries for Android
You can use Glide or Picasso for that. It's very easy to implement.
Here is a guide that explains a little as the two libraries and do what you ask.

apply pinch and zoom to every page android application

Hi guys i have a medical application for android that will be used by the elderly. The problem is when they use the application they struggle to see the print. So i am looking to apply the pinch and zoom technique to the whole app so each page viewed can be zoomed in to make the font clearer. Can anybody point me in the right direction. I have looked at pinch and zoom examples and even downloaded some but they focus on images specifically. where as i want the content on every page to still function the way they do. i.e buttons etc. But i want every page to allow its users to zoom in.
This whole "Pinch and Zoom" thing is not really that usable as it requires a very high API to be used I think you should scrap it and try using the SeekBar that is connected to the size of the text it's a lot easier and it's something I have managed to implement quite easily in my apps from a very low API level. You can check this image of a snapshot of my App.
https://lh4.ggpht.com/9LDEkOV-QotFPHEa9SDpIHZ1OtgMgSDFdcrTsR1DZuBjpwonlAmREhhJQc3znVQ_LEo
If you want some code for this I may post it if you want

Drawing API for java?

I want to be able to draw and erase on an image in java (NOT javascript). Are there any APIs for that? Bonus points if i can also draw vectors, but it's not necessary. I want to use it in my program, so I'm not looking for a stand alone program. Thank you!
Why not use the graphics classes built into java? There is a simple tutorial for this here. You really just need to get a graphics context and then you can draw whatever you like on the image.
Another option would be to use Processing
diagrams and images can be drawn using an API that can produce SVG images. I can remember two API's that are capable of this. One of them is Batik and the other is SVG Salamander.

Categories