Q:

Read images from website using Imagero Java library

From the tutorial and information that I have seen so far, Imagero can only read image from a directory. Anyone uses Imagero lib before and knows if it can read image directly from an url?
Also, I am trying to perform image processing such as darken/brighten an image in a jsp page. Can imagero achieves that for me?
I am stuck and need some advises.
Imagero: http://reader.imagero.com/

A:

You don't need an external library for downloading an image from a URL; just treat it as if you were downloading any other file. Luckily the ImageIO class provides a method called read(URL) which can be found here which is used for specifically for downloading images. 
As far as modifying the BufferedImage, I would suggest looping through the width and height (representing the x and y) and get the RGB of each pixel at row,column using BufferedImage#getRGB(int, int) and modify the color and set the color at that location using BufferedImage#setRGB(int, int, int).
There are 2 different ways I could think of darkening an image: one way being to loop through each x,y and darken each individual color and the other way being to essentially draw a translucent screen over the image, both methods will be shown below:
public void darken(final BufferedImage image){
    for(int x = 0; x < image.getWidth(); x++)
        for(int y = 0; y < image.getHeight(); y++)
            image.setRGB(x, y, new Color(image.getRGB(x, y)).darker().getRGB());
}

public void darken(final BufferedImage image, final int intensity){
    assert intensity >= 0 && intensity <= 255;
    final Graphics g = image.getGraphics();
    g.setColor(new Color(0, 0, 0, intensity));
    g.fillRect(0, 0, image.getWidth(), image.getHeight());
    g.dispose();
}

Note about the second method: the higher the intensity = the darker the image gets.

