java - RGB retrieval of a coloured image -
i trying image processing on coloured image , me need separate rgb values , modify them separately. implementing increase in brightness filter. doing in java. can me out please
you have few options.
first, need able load image supports bufferedimage
class. this, you're best using imageio
api. take @ reading/loading image.
once have this, can obtain pixel information in verity of ways.
one of simplest use bufferedimage#getrgb
, returns packed integer of pixel.
depending on type of image, can obtain individual color values color(int, boolean)
, unpack integer accordingly (you can manually, never remember maths , simpler).
alternativly, can access raster
directly, via bufferedimage#getdata
, provides access more methods manipulating underlying pixel information (such grabbing regions of pixels example)
now, if sounds more fun can handle, can perform image brightening using bufferedimageop
...
see, adjust brightness , contrast of bufferedimage in java , how change contrast , brightness of image stored pixel values , change brightness of image using rescaleop examples (these top few popped on google)
Comments
Post a Comment