Edit image and save to the gallery

Looks like, if the original image dimensions are important to you, that you need to apply the watermark to the original image, not one loaded into an image component. I am not sure if there is an extension available that does that (it should be possible).

Still may be possible with the canvas, but would need to test.

1 Like

Canvas doesn't like to be as big as an image from camera (found this previously when working with a larger canvas).

Explain why your images need to be full size ?

Adding a watermark to the original image seems quite doable:

https://stackoverflow.com/questions/10679445/how-might-i-add-a-watermark-effect-to-an-image-in-android

If I get time and the inclination I will have a go.

Here is a test app with a small extension (only one method) that creates a new image with watermark using compressionQuality = 100. So the new image should have the best quality and the same dimension as the original one (taken by the Camara component).

watermark.aia (83.4 KB)

Watermark feature now added to the Image Convertor extension. This will take the path of an image on the device and output the modified image as a PNG.

I have noticed that the methods used to modify the file can vastly increase the file size of the image (a large image can take quite a few seconds to complete) If this is the case for you, and the file size is too large, you can use the Image Convertor extension to resize the output image back to what it was...

image

The original photo is 1.3 MB in size, while the new image is 7.1 MB. With my extension (compressionQuality = 100), the difference is much smaller.

Yes, and it seems to vary depending on device. I am sure we are doing much the same thing in our extensions, not figured out yet what is doing it in mine.

Have added the BitmapFactory options, this may help:

BitmapFactory.Options options = new BitmapFactory.Options();
    options.inScaled = false;

    Bitmap bitmap = BitmapFactory.decodeFile(etarget,options);

hmmm, did not appear to help a great deal...