By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,281 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,281 IT Pros & Developers. It's quick & easy.

Adjusting brightness in images using JAI lookup tables

P: n/a

I have written a program using JAI for a project I am doing which can
be used to adjust the brightness of an image. It all works fine but I
now need to write it all up and am not entirely sure what it is doing.

The code is below:

public void adjustLight(int ipParam){ // ipParam = 18
pb = new ParameterBlock();
byte lookUpTableData[];
lookUpTableData = new byte[256];
for(int j = 0; j < 256; j++){
lookUpTableData[j] = clampByte(j + ipParam);

LookupTableJAI lookUp = new LookupTableJAI(lookUpTableData);

image = JAI.create("lookup", pb, null);

private final byte clampByte(int i){
if(i > 255)
return -1;
if(i < 0)
return 0;
return (byte)i;

I am unsure about what the clampByte method is doing and was a bit
confused by the lookup operation.

If anyone could help I would be very grateful. Thank you.

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.