[F/OS] 🖼️ ImageUtil - Additional Tools To The Image Component!

:computer: Introduction

A non-visible extension that provides additional tools to the built-in Image component.

:package: Package name: com.gordonlu.imageutil.aix

:clock1: Version: 5

:date: Release date: 2022-03-08T06:00:00Z

:lollipop: Minimum API: 19 (Android 4.4 KitKat)

:open_book: Documentation

Method blocks

ApplyGrayscaleAndFade

image

Applies grayscale effect to an image and fades the image.

Parameters: component = image

ApplyWatermark

image

Applies watermark text to the given image's content. Set the text of the watermark via the watermark parameter, and the x and y parameters are the co-ordinates of the watermark located on the image. The parameter color is the text color of the watermark, and alpha is the luminance of the watermark. The size parameter is the size of the watermark in points. Specify whether to underline the watermark via the underline boolean parameter. Use the blocks in the properties of this extension for the font parameter. If useCurrentFont is true, the font parameter will be ignored.

Parameters: image = component, watermark = text, x = number (int), y = number (int), color = color, alpha = number (int), size = number (int), underline = boolean, font = text, useCurrentFont = boolean

ColorBoost

image

Applies color boost to the content of the given content. To find out the type parameter, go to: Color Boost the image(Bitmap) in ImageView (Android) ~ Hamad's blog | Android News,Tutorials and Code-snippets. type should be a value, either 1, or 2, or 3.

Parameters: image = component, type = number (int), percent = number (float)

GammaEffect

image

Applies gamma effect to the given image.

Parameters: image = component, red = number (double), green = number (double), blue = number (double)

HueFilter

image

Sets the hue filter for the image, with the given level.

Parameters: image = component, level = number (int)

ImageAlpha

image

Returns the alpha that was applied to this ImageView. This will probably be a value between 0 and 255.

Returns: number (int)

Parameters: image = component

IsCroppedToPadding

image

Checks whether this image is cropped to padding.

Returns: boolean

Parameters: image = component

RoundCorners

image

Applies round corners to the Image, with the radius parameter as the radius of each corner.

Parameters: image = component, radius = number (int)

SepiaToningEffect

image

Turns the image to a Sephia Toned version of the image, by specifying the depth, red, green and blue parameters.

Parameters: image = component, depth = number (int), red = number (double), green = number (double), blue = number (double)

SetBrightness

image

Sets the brightness of the content for the given image, according to the value parameter.

Parameters: image = component, value = number (int)

SetColorDepth

image

Sets the color depth of the image.

Parameters: image = component, bitOffset = number (int)

SetCropToPadding

image

Sets whether the image should crop to padding.

Parameters: image = component, cropToPadding = boolean

SetImageAlpha

image

Sets the alpha value that should be applied to the image.

Parameters: image = component, alpha = number (int)

SetImageTintColor

image

Change the image tint color. You can use too alpha values if you want with the 'make a list' block. Do not forget to use the 'make color' block together with the 'make a list' block.

Parameters: image = component, tint = color

SetPadding

image

Sets the padding of the given image.

Parameters: image = component, left = number (int), top = number (int), right = number (int), bottom = number (int)

UndoGrayscaleAndFade

image

Undos the grayscale and fade effects applied with the AplyGrayscaleAndFade method.

Parameters: image = component

:inbox_tray: Downloads

AIX:
com.gordonlu.imageutil.aix (14.8 KB)

For the source code, here you go. Go to the GitHub repo, and don't forget to :star2: it!

:+1: Rate my extension! :-1:

  • Good extension!
  • Bad extension.

0 voters


Made with Niotron IDE.

Kindly :email: PM me if you have any questions! Also, if you like my extension, please :heart: like it! It takes some effort for me to make it...

Votes and likes tell me the general user feedback of my extension. If you read this extension, please take 20 seconds to drop by and give a vote / like!

If you have any features that you want to add and you know the code, PM me or directly reply below using the image button.

By downloading my extension, you agree the terms and conditions in my website


Gordon Lu

:speech_balloon: Message :earth_africa: Website :e-mail: E-mail

8 Likes

tests:

Companion

aiStarter emulator - does not work.

Xiaomi RedMi Note 10 - Works.

Profile.aia (87.4 KB)

interestingly, during testing, i figured out how to turn the image to black-and-white.

and then undo it via the UndoGrayscaleAndFade method.

1 Like

Two new methods added in version 2.

ApplyWatermark

image

Applies watermark text to the given image's content.

Parameters: image = component, watermark = text, x = number (int), y = number (int), color = color, alpha = number (int), size = number (int), underline = boolean

RoundCorners

image

Applies round corners to the Image, with the radius parameter as the radius of each corner.

Parameters: image = component, radius = number (int)

1 Like

:confetti_ball: Version 3!

  • Updated ApplyWatermark. You can now set the watermark font to Serif, Monospace, Default and Sans Serif!

ApplyWatermark

image

Applies watermark text to the given image's content. Set the text of the watermark via the watermark parameter, and the x and y parameters are the co-ordinates of the watermark located on the image. The parameter color is the text color of the watermark, and alpha is the luminance of the watermark. The size parameter is the size of the watermark in points. Specify whether to underline the watermark via the underline boolean parameter. Use the blocks in the properties of this extension for the font parameter. If useCurrentFont is true, the font parameter will be ignored.

Parameters: Parameters: image = component, watermark = text, x = number (int), y = number (int), color = color, alpha = number (int), size = number (int), underline = boolean, font = text, useCurrentFont = boolean

By defining the font parameter, say hello to these properties.

image

  • Cool effects for your images!

ColorBoost

image

Applies color boost to the content of the given content. To find out the type parameter, go to: Color Boost the image(Bitmap) in ImageView (Android) ~ Hamad's blog | Android News,Tutorials and Code-snippets. type should be a value, either 1, or 2, or 3.

Parameters: image = component, type = number (int), percent = number (float)

GammaEffect

image

Applies gamma effect to the given image.

Parameters: image = component, red = number (double), green = number (double), blue = number (double)

:partying_face: Version 4!

  • Some more cool effects for your Images!

SepiaToningEffect

image

Turns the image to a Sephia Toned version of the image, by specifying the depth, red, green and blue parameters.

Parameters: image = component, depth = number (int), red = number (double), green = number (double), blue = number (double)

SetBrightness

image

Sets the brightness of the content for the given image, according to the value parameter.

Parameters: image = component, value = number (int)

  • Customizing your image by setting paddings!

SetCropToPadding

image

Sets whether the image should crop to padding.

Parameters: image = component, cropToPadding = boolean

SetPadding

image

Sets the padding of the given image.

Parameters: image = component, left = number (int), top = number (int), right = number (int), bottom = number (int)

EDIT 1: This extension is now added on GitHub.

:partying_face: Version 5!

  • More cool effects for your images!

HueFilter

image

Sets the hue filter for the image, with the given level.

Parameters: image = component, level = number (int)

SetColorDepth

image

Sets the color depth of the image.

Parameters: image = component, bitOffset = number (int)

2 Likes