How to compress the image without loosing quality of the image - java

I have implemented document scanning by camscanner sdk. While taking pictures with high pixel cameras will consume more MB of each picture. Even after editing with camscanner sdk, sometimes it exceeds a MB. So this reason i tried whats app compression algorithm to compress the image but its totally decreases the quality. Now, i want to know is there any other possibilities or ideas to compress the picture with in certain KB's. So that the devices which has slow data connection can easy to upload images to server... So now the camscanner sdk doing perfectly but only thing need to decrease the size of an image else required any other idea..

Please do some search and find out. If you use NDK, better to proceed with tessarat
http://kurup87.blogspot.in/2012/03/android-ocr-tutorial-image-to-text.html
Or simple OCR by using api given. Hope this might help
https://github.com/smart-mobile-software/ocrapiservice

Related

API minimize data usage

I'm making games app on android using RAWG Video Games Database.
This is how the app look like.
the problem is the API provide large image size average 1.5 MB,
it's too big for small size space in the app, and lots of data wasted.
all the solutions i found was for better performance "after downloading" the image
by scale down the resolution.
is there anyway i can make the image smaller "before download"?
or is there other APIs provide me small image for thumbnail and another one as original size?
Why not download it, make it smaller, and then delete the old version?

How to resize high resolution tif images efficiently and quickly?

I am working on a project where I have users uploading print quality high resolution tif images and I need to create a lower resolution web quality preview for the user if/when they come back to view what they uploaded.
Currently I have a working solution to resize these images using ImageIO.read and ImageIO.write but it is taking up to 15 minutes to modify and save these preview images. I am wondering if there is a better solution that would take less time to complete. Or is this a RAM issue that I am experiencing?
I'm not sure what libraries you're using, but you can do this in two passes. If you're cutting the resolution by half in width and height, then simply take every other pixel and create a quick image from that. It will be low quality, but you should be able to do this very quickly even on large images. Later, perhaps with a workflow automation system, you can "slow cook" a better-quality derez and take some time to do it well.

Why my project works on android but not on ios in codenameone?

I work on a big project with codenameone(i can't attach my codes because it's really big). I get android app and it's works on android devices. But recently i get ios build for this project and it's not working on ios device(just showing a white page instead of map).
My project is a map-framework that render tiles and ... on graphics(i used graphics class for drawing, transforming, writing text and more).
I used input stream for working with file because of File not supported.
I need a solution to how debug and find my problem about ios build(why tiles doesn't showed).
In fact i don'n know anything about ios and objective-c.
Thanks in advance.
Most of the logging functionality that allows inspecting issues is for pro developers (you can try the trial) its discussed in this video (mostly focused on crashes): http://www.codenameone.com/how-do-i---use-crash-protection-get-device-logs.html
From your description I would guess you created a really large mutable image (larger than screen bounds) and are drawing onto that. This would be both slow on iOS (and on newer Android devices) and might actually produce that result if the image exceeds the maximum texture size of the device.
If that is not the case you would need to explain what you are doing more precisely.

Reduce video size/quality in android

I've been looking for this for some time now but I couldn't find anything useful. Is there a way to reduce the size / resize of an existing video in android? I want to send it via the network.
Thanks a lot!
There is nothing built into Android for this. You are welcome to research third party code that might do this for you. Bear in mind that most Android devices run on low-power CPUs and have relatively slow flash memory, and so re-sizing a video may take a very long time.

Android drawable paradigm!

I have been developing Android application since 3 to 4 months. I am naive, But pretty much exposed to all of the fundamentals regarding application development on android. However I found really painful while developing application with lots of images, By saying images I mean one of my application has around 10 to 13 images(Small enough to accommodate screen size). The problem is I have to make different copies of it by making,
HDPI - High resolution support
MDPI - Medium resolution support
LDPI - Low resolution support
I have come up with an idea,
IDEA : My idea is to actually have only MDPI images in drawable folder, When my
application will installed first time, I want my application to detect what type of
resolution is supported by device? After knowing which resolution is supported one of my
built in method will either use a MDPI version(images), if handset supports it or else
it will scale up or scale down my images and stores into internal storage for future
reference. When user uninstall my application I will remove these images from internal
storage.
Now this idea has raised a question,
Question :
Whether this idea is feasible? and Programatically possible?
If it is, Should I be really concerned about one time computational overhead?
Is there any mechanism(third party) which can ease my problem? (I hate photoshop and scaling up and down all those images)
Any expert help or guidance will be a big favour!
Thanks in advance!
Krio
I dont really understand why you would do this. The system already basically does this for you. You dont have to specify different images for different display densities, the system just gives you the opportunity to so you can make your app look its best. If you only supply a single image the system will scale it appropriately for you based on the density of the handset.
As for help with scaling the images yourself for packaging, you could look at image magick. This is a powerful scriptable image manipulation tool. You might need to spend a bit of time getting up to speed with it, but I am sure you could write a script that you could reuse for all of your images after that to convert high dpi images to lower dpi ones by scaling down.
Take a look to this article. It describes how android handle directory names for resources. Also take a look a look to this - how android choose the best match for directory name. If you want to use the same resource for all dpis just place it in the default drawable folder.

Categories