So far, I am able to achieve the default crop options available in the devices. But my requirement is like cropping the image with 4 dots, so that any image can be cropped to any shape.
Any idea , how this can be achived. DocumentScanner application already uses this feature.
Related
I have png images that have drop shadow. There is no unproportional images scaling problem, scaling are according to the aspect ratio.
When I using Image.asset() for placing images on phone screen, they're and their shadows looks low quality and not soft.
Original image looks: http://prnt.sc/p93vo2
Image on Android App: https://prnt.sc/p93vz3
Example images are same and 700x400, 96dpi.
You should see quality difference between images.
There is also a strange stuation. The shadow density on right and bottom side is more than shadow of original image on android app.
I've tried FilterQuality.high but no change, how to fix it?
In my case, the problem was due to a bad configuration of the image resolution system.
Full answer SO: Images loose quality when using image.asset in flutter
.
I want to add a background image to my layout by adding a big image and then set android dynamically crop my image from center for different android devices. I have tried lots of ways but i cant find any way of doing this specific job.
I need to implement the custom image cropping instead of using the system cropping (i.e. "com.android.camera.action.CROP"). I need to know the exact position of the cropping bounding box but this information is not retrievable if I choose to use the default cropping. Besides, the bitmap image is down sampled too much by default cropping.
The steps are as following:
Create the original size bitmap from source (using uri). The
original size is about 4000x3000 which is too big.
The user defines the crop area to extract the ROI which results in resizing of the original image to fit the ImageView. (size of ImageView is about 700x700)
Record the position of the bounding box in the ImageView.
Retrieve the cropped area from the original image and create another bitmap for it.
Resize the cropped bitmap to fit the imageview size to show it on the screen.
This approach works on my device (ZTE nuoio with Android 4.3) well. However, the app crashes on Samsung S4 with Android 4.4.4 and Note 4 while performing step 1 probably because of the out-of-memory error.
Therefore, I try to do another approach that creates the bitmap which is down sampled from the source image, rather than having the original size bitmap image.
I need to have the information of the exact position of cropped area from the original image. That is the reason why I didn't use default cropping. Could you please help me out with my case either providing
the solutions to derive the exact coordinates of the bounding box of the cropped image in the original image as a matrix.
how to solve the out-of-memory error in step 1 using the approach I mentioned above.
Or other approach to achieve image cropping with knowing the exact coordinates of cropped area form the original image.
Thank you so much.
For Crop an image and get Coordinates use library Edmodo Croper https://github.com/edmodo/cropper
For Out of memory issue you have to down scale image.
I want to crop selected image in circular shape from gallery. I have checked few solution for same question, but I am not able to solve my issue. Maximum solution provide for custom shape imageview means provide a .xml file or class extends with Imageview but I want to crop image like following screenshot or Instagram app crop image.
If you do not mind to use a library.Use SimpleCropView library,it has circle crop mode.
https://github.com/IsseiAoki/SimpleCropView
I am trying to implement Tesseract library to get text from the image, it works in some cases but in mostly it fails.
I am using this library in my Android project: https://github.com/rmtheis/tess-two
I am trying with this image
Actual Result
Expected Result
Wikipedia
The free Encyclopedia
Any suggestions as to why it's not working?
It's not working because of:
The uneven illumination in the image
The presence of part of the globe graphic at the top of the captured image.
By taking a picture of the screen, you're introducing some darker areas on the image that's captured. To fix it, you could use the image directly instead of taking a picture, or you could add code to your app to adjust for the uneven illumination.
With different illumination, and cropping around the text area, I get a better result: