1 Reading an image
To read an image simply pass any data convertible to byte[]
<script> var src = Ax.util.Base64.decode("iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAMAAAD8CC+4AAAArlBMVEUAAAD+yRf/yRb/pAj/kxH+mhb/mRb+mRb+mhb+mRf+mhb/mhf+mhb+mhb+mhb/gwD+mhb+mRf+mRb+mRb+mRT+mhf+owD+mRb+mRb+mRb+mRb/mRb+mRb+mRb/mhb+mRf+mRb+mRb+mRb+mRb/mRb+mRb+mRX+mhb+mxX+mBT+mRb+mRX+mRb/mhX+mRb+mRb+mRX+mRb+mRX+mRb+mhb+mRX+mRb+mRb/mhf/yRegVLefAAAAOHRSTlMATMwGEPy/yfaDS/L54BYCWQrp7BsgA2xBpJnNqo+IKbBg0sSflGe7OiW2RnFS5Nt11i/uen9ONIPwOQAAAA4zSURBVHja7MGBAAAAAICg/akXqQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYPbgQAAAAAAAyP+1EVRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdi7E+VEgSgKw7cKWskg4IKK+x73uI6e93+yqcnMZGygoREiVtnfA9zE+kt6MVYURcldQyPl1Xg2Ka+mtyDl1Vh7Ul7MAgVSXkwbzCXlpVRM4EzKS3kHYDmkvBBnDABbUl7IGr9N6Dscm9PCwbIOk2F/NFAPk+cxx6cFZc1+s3Dr1B3p9EnvcNqkPNYVf6woW5W+gYBS13N+R8ctdWB8uCH+8ihL1x3Cjesqet6uDH8VHcrOxYAA01X0vK3wpZxh8xJEJurxnjcP/1kaZeRqQOhNRc/bBDfOlA3dgthCRc/ZFrcMlzLRhpipqej50nbgdCkLRwaxIano+drDx8voECi2UdHzZZvwOWiU2pIhwkBFz9cUAWdKrQ8/ozBtd4sGAHyQip6rBUOAUaeUHAs8c1Oh37RF38JURc9Vo4MQK0rpCF51QF+ci6ei52qDUOVsxzKPOCp6nlwToao6p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FDtIcHpdAQC5UYYnlVgEAvgbauMy3xgQ8t4GYmojogtz6I5c0nbvASzEav86+0AO3BfhSc25ph6NF4Npl7FlBQhpjOPSgxxGn5NoRJGYJa926Hr+440g2t7c9eQxtEGCdusgPk1gKJghb6nc0SJyU85DYAqdqhrxJnohQDeW1BqnbofXxzhF/qAnbZpGqHPsCfbpUJU+Tkg1Tx0GtqYmlzw185I1U8dPATC2nWEfmsQap66KtkY4Q+8vFAqnro12Ttsh0hjwikyodu68meBvO7dgv9IN00HxQ6uEQVdXDPpZlv0s2HR4UeEtUP3TaWZloy9CcIvWcSx3U2GkfZjAz9CUKHPfmI3TBKtx+RoT9F6LUOeax/oGMpI5ChP0Xo8AV/M2vwxjtjCYYjQ3+S0P96Mt/1/vzlRMXCJiBDf5LQoZX6mO25RWPv1GToTxM6BOllis6nIxYxBxn684Tu6FkVzE5r6r7UI2QxAxn6E4UeK4Id2kBodJAqasrQnyp0GFGO7wyQxtgAi4/SzeaxoSsLvNFSjt/4ch/9bqx+zAHugX6u3g8pB4cJU5CejxPh3xaH2NVumZhrZIH0hLw2xkTTzS33tcz837SNMKEz+3K4NBWr+0mV9/Z/VNfHMtQ9SN/Zt5PUhIIACKAN2gkJGYxJHBa2ouKEIjj2/U/m2oXy//I3712hoKAW1VztSa7v+B5osu9TzDW9/gcabrXPdcRzK9B4PynmymaHQBHGk1zNZ8dSK8d1EytEvtDsZRmPfvMzcblzSS5P6zLvPkr8ZfsXKNShP5x+5DvdZbq0A2XrrQed/jml9HZa7K5fAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODGHhwIAAAAAAD5vzaCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq0BwcCAAAAAIL8rQe5AgAAAAAAHgKWYe6TlvpEzwAAAABJRU5ErkJggg=="); var img = new Ax.image.Image(src); </script>
file:
, http:
, https:
, base64:
or any object convertibe to InputStream. For example a Blob or a Ax.io.File.
Some methods can provide information about the image.
Return | Method | Description |
---|---|---|
int | getSize | Returns the size in bytes |
int | getWidth | Returns the width in pixels |
int | getHeight | Returns the height in pixels |
String | getFormat | Returns the image format (png, jpeg, ...) |
boolean | isTransparent | Returns the image is transparent |
int | getDominantColor | Returns the int rgb of the dominat color in the image |
2 toOptimumQuality
Image is playing a vital role in websites, web apps, and mobile apps. When we develop any kind of website image is most important to describe things easier than words and making good look and feel of the website.
But when comes to memory size image is on the higher side than the word right!. Here memory size is most important for website development. So You want to use the images with your website at the same time it won't affect your website loading speed.
For this situation, you should reduce the image memory size to increase the loading speed of websites. From an SEO point of view also image plays a vital role in website development. So avoiding images is not a good thing but using images with reduced memory size is good for any kind of website.
The below snippet is used to reduce the image memory size without affecting its resolution.
<script> var src = Ax.util.Base64.decode("iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAMAAAD8CC+4AAAArlBMVEUAAAD+yRf/yRb/pAj/kxH+mhb/mRb+mRb+mhb+mRf+mhb/mhf+mhb+mhb+mhb/gwD+mhb+mRf+mRb+mRb+mRT+mhf+owD+mRb+mRb+mRb+mRb/mRb+mRb+mRb/mhb+mRf+mRb+mRb+mRb+mRb/mRb+mRb+mRX+mhb+mxX+mBT+mRb+mRX+mRb/mhX+mRb+mRb+mRX+mRb+mRX+mRb+mhb+mRX+mRb+mRb/mhf/yRegVLefAAAAOHRSTlMATMwGEPy/yfaDS/L54BYCWQrp7BsgA2xBpJnNqo+IKbBg0sSflGe7OiW2RnFS5Nt11i/uen9ONIPwOQAAAA4zSURBVHja7MGBAAAAAICg/akXqQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYPbgQAAAAAAAyP+1EVRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdi7E+VEgSgKw7cKWskg4IKK+x73uI6e93+yqcnMZGygoREiVtnfA9zE+kt6MVYURcldQyPl1Xg2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//I3712hoKAW1VztSa7v+B5osu9TzDW9/gcabrXPdcRzK9B4PynmymaHQBHGk1zNZ8dSK8d1EytEvtDsZRmPfvMzcblzSS5P6zLvPkr8ZfsXKNShP5x+5DvdZbq0A2XrrQed/jml9HZa7K5fAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODGHhwIAAAAAAD5vzaCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq0BwcCAAAAAIL8rQe5AgAAAAAAHgKWYe6TlvpEzwAAAABJRU5ErkJggg=="); var img = new Ax.image.Image(src).toOptimumQuality(); new Ax.io.File("/tmp/image.jpg").write(img.getBytes()); </script>
3 Scale
You can scale an image using percent factor.
<script> var src = Ax.util.Base64.decode("iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAMAAAD8CC+4AAAArlBMVEUAAAD+yRf/yRb/pAj/kxH+mhb/mRb+mRb+mhb+mRf+mhb/mhf+mhb+mhb+mhb/gwD+mhb+mRf+mRb+mRb+mRT+mhf+owD+mRb+mRb+mRb+mRb/mRb+mRb+mRb/mhb+mRf+mRb+mRb+mRb+mRb/mRb+mRb+mRX+mhb+mxX+mBT+mRb+mRX+mRb/mhX+mRb+mRb+mRX+mRb+mRX+mRb+mhb+mRX+mRb+mRb/mhf/yRegVLefAAAAOHRSTlMATMwGEPy/yfaDS/L54BYCWQrp7BsgA2xBpJnNqo+IKbBg0sSflGe7OiW2RnFS5Nt11i/uen9ONIPwOQAAAA4zSURBVHja7MGBAAAAAICg/akXqQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYPbgQAAAAAAAyP+1EVRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdi7E+VEgSgKw7cKWskg4IKK+x73uI6e93+yqcnMZGygoREiVtnfA9zE+kt6MVYURcldQyPl1Xg2Ka+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hoKAW1VztSa7v+B5osu9TzDW9/gcabrXPdcRzK9B4PynmymaHQBHGk1zNZ8dSK8d1EytEvtDsZRmPfvMzcblzSS5P6zLvPkr8ZfsXKNShP5x+5DvdZbq0A2XrrQed/jml9HZa7K5fAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODGHhwIAAAAAAD5vzaCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq0BwcCAAAAAIL8rQe5AgAAAAAAHgKWYe6TlvpEzwAAAABJRU5ErkJggg=="); var img = new Ax.image.Image(src).scale(.5); new Ax.io.File("/tmp/image.jpg").write(img.getBytes()); </script>
4 Resize
You can resize an image to a target width or width and height.
<script> var src = Ax.util.Base64.decode("iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAMAAAD8CC+4AAAArlBMVEUAAAD+yRf/yRb/pAj/kxH+mhb/mRb+mRb+mhb+mRf+mhb/mhf+mhb+mhb+mhb/gwD+mhb+mRf+mRb+mRb+mRT+mhf+owD+mRb+mRb+mRb+mRb/mRb+mRb+mRb/mhb+mRf+mRb+mRb+mRb+mRb/mRb+mRb+mRX+mhb+mxX+mBT+mRb+mRX+mRb/mhX+mRb+mRb+mRX+mRb+mRX+mRb+mhb+mRX+mRb+mRb/mhf/yRegVLefAAAAOHRSTlMATMwGEPy/yfaDS/L54BYCWQrp7BsgA2xBpJnNqo+IKbBg0sSflGe7OiW2RnFS5Nt11i/uen9ONIPwOQAAAA4zSURBVHja7MGBAAAAAICg/akXqQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYPbgQAAAAAAAyP+1EVRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdi7E+VEgSgKw7cKWskg4IKK+x73uI6e93+yqcnMZGygoREiVtnfA9zE+kt6MVYURcldQyPl1Xg2Ka+mtyDl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1VztSa7v+B5osu9TzDW9/gcabrXPdcRzK9B4PynmymaHQBHGk1zNZ8dSK8d1EytEvtDsZRmPfvMzcblzSS5P6zLvPkr8ZfsXKNShP5x+5DvdZbq0A2XrrQed/jml9HZa7K5fAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODGHhwIAAAAAAD5vzaCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq0BwcCAAAAAIL8rQe5AgAAAAAAHgKWYe6TlvpEzwAAAABJRU5ErkJggg=="); new Ax.io.File("/tmp/image_x1.jpg").write(src); var img = new Ax.image.Image(src).resize(64); new Ax.io.File("/tmp/image_x2.jpg").write(img); </script>
5 Rotate
You can rotate an image using a rotation operator like:
- CW_90
- CW_180
- CW_270
- FLIP_HORZ
- FLIP_VERT
<script> var src = Ax.util.Base64.decode("iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAMAAAD8CC+4AAAArlBMVEUAAAD+yRf/yRb/pAj/kxH+mhb/mRb+mRb+mhb+mRf+mhb/mhf+mhb+mhb+mhb/gwD+mhb+mRf+mRb+mRb+mRT+mhf+owD+mRb+mRb+mRb+mRb/mRb+mRb+mRb/mhb+mRf+mRb+mRb+mRb+mRb/mRb+mRb+mRX+mhb+mxX+mBT+mRb+mRX+mRb/mhX+mRb+mRb+mRX+mRb+mRX+mRb+mhb+mRX+mRb+mRb/mhf/yRegVLefAAAAOHRSTlMATMwGEPy/yfaDS/L54BYCWQrp7BsgA2xBpJnNqo+IKbBg0sSflGe7OiW2RnFS5Nt11i/uen9ONIPwOQAAAA4zSURBVHja7MGBAAAAAICg/akXqQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYPbgQAAAAAAAyP+1EVRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdi7E+VEgSgKw7cKWskg4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HMtQ9SN/Zt5PUhIIACKAN2gkJGYxJHBa2ouKEIjj2/U/m2oXy//I3712hoKAW1VztSa7v+B5osu9TzDW9/gcabrXPdcRzK9B4PynmymaHQBHGk1zNZ8dSK8d1EytEvtDsZRmPfvMzcblzSS5P6zLvPkr8ZfsXKNShP5x+5DvdZbq0A2XrrQed/jml9HZa7K5fAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODGHhwIAAAAAAD5vzaCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq0BwcCAAAAAIL8rQe5AgAAAAAAHgKWYe6TlvpEzwAAAABJRU5ErkJggg=="); var img = new Ax.image.Image(src).rotate("CW_180"); new Ax.io.File("/tmp/image.jpg").write(img.getBytes()); </script>
6 Is transparent
To determine if image has alpha channel
<script> var src = Ax.util.Base64.decode("iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAMAAAD8CC+4AAAArlBMVEUAAAD+yRf/yRb/pAj/kxH+mhb/mRb+mRb+mhb+mRf+mhb/mhf+mhb+mhb+mhb/gwD+mhb+mRf+mRb+mRb+mRT+mhf+owD+mRb+mRb+mRb+mRb/mRb+mRb+mRb/mhb+mRf+mRb+mRb+mRb+mRb/mRb+mRb+mRX+mhb+mxX+mBT+mRb+mRX+mRb/mhX+mRb+mRb+mRX+mRb+mRX+mRb+mhb+mRX+mRb+mRb/mhf/yRegVLefAAAAOHRSTlMATMwGEPy/yfaDS/L54BYCWQrp7BsgA2xBpJnNqo+IKbBg0sSflGe7OiW2RnFS5Nt11i/uen9ONIPwOQAAAA4zSURBVHja7MGBAAAAAICg/akXqQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYPbgQAAAAAAAyP+1EVRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdi7E+VEgSgKw7cKWskg4IKK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Q9SN/Zt5PUhIIACKAN2gkJGYxJHBa2ouKEIjj2/U/m2oXy//I3712hoKAW1VztSa7v+B5osu9TzDW9/gcabrXPdcRzK9B4PynmymaHQBHGk1zNZ8dSK8d1EytEvtDsZRmPfvMzcblzSS5P6zLvPkr8ZfsXKNShP5x+5DvdZbq0A2XrrQed/jml9HZa7K5fAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODGHhwIAAAAAAD5vzaCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq0BwcCAAAAAIL8rQe5AgAAAAAAHgKWYe6TlvpEzwAAAABJRU5ErkJggg=="); var img = new Ax.image.Image(src); console.log(Ax.lang.String.format("Is transparent: %b", img.isTransparent())); <script>
7 Get dominant color
Grabs the dominant color or a representative color palette from an image. It's based on a very fast Java port of Lokesh Dhakar's color-thief JavaScript version .
The function getDominantColor
returns the int rgb of dominant color of the image.
<script> var src = Ax.util.Base64.decode("iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAMAAAD8CC+4AAAArlBMVEUAAAD+yRf/yRb/pAj/kxH+mhb/mRb+mRb+mhb+mRf+mhb/mhf+mhb+mhb+mhb/gwD+mhb+mRf+mRb+mRb+mRT+mhf+owD+mRb+mRb+mRb+mRb/mRb+mRb+mRb/mhb+mRf+mRb+mRb+mRb+mRb/mRb+mRb+mRX+mhb+mxX+mBT+mRb+mRX+mRb/mhX+mRb+mRb+mRX+mRb+mRX+mRb+mhb+mRX+mRb+mRb/mhf/yRegVLefAAAAOHRSTlMATMwGEPy/yfaDS/L54BYCWQrp7BsgA2xBpJnNqo+IKbBg0sSflGe7OiW2RnFS5Nt11i/uen9ONIPwOQAAAA4zSURBVHja7MGBAAAAAICg/akXqQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYPbgQAAAAAAAyP+1EVR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h3xaH2NVumZhrZIH0hLw2xkTTzS33tcz837SNMKEz+3K4NBWr+0mV9/Z/VNfHMtQ9SN/Zt5PUhIIACKAN2gkJGYxJHBa2ouKEIjj2/U/m2oXy//I3712hoKAW1VztSa7v+B5osu9TzDW9/gcabrXPdcRzK9B4PynmymaHQBHGk1zNZ8dSK8d1EytEvtDsZRmPfvMzcblzSS5P6zLvPkr8ZfsXKNShP5x+5DvdZbq0A2XrrQed/jml9HZa7K5fAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODGHhwIAAAAAAD5vzaCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq0BwcCAAAAAIL8rQe5AgAAAAAAHgKWYe6TlvpEzwAAAABJRU5ErkJggg=="); var img = new Ax.image.Image(src); console.log(Ax.lang.String.format("Main color: %b", img.getDominantColor())); <script>