We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Create draw( ) function, and design following mechanisms along with for loop to read pixels; a)image( ) function to draw
b)Use red( ), green(), and blue( ) functions to show only red, green, or blue channels.
c)Mapping between the pixel position, bar height, bar color and font color: To show an interactive RGB value on a specific pixel based on the position of mouse cursor (mouseX& mouseY), create a bar graph (use rect( ) to create a bar per each color). Useful Processing commands; •text( ), textFont( ) •Color, image( ), fill( ) •updatePixels(); •loadPixels();
d)Based on simple math operators (+, -, *, %), design minimum 4 filters operated through key board interaction.
Answers
My Code
Producing this output:
homework?
please look up how to post code - there is a sticky post on that
did you solve task a) with that or b) ? Or all?
DO you have a question?
I COULD ONLY SOLVE A AS B DOES NOT WORK FOR ME
i need a little help fixing my code so i could get B and C
For B:
I think you are supposed to use a loop to iterate over all pixels of the image and then use the functions red(), blue() and green() to extract the different channels.
You could have a look at this tutorial, there is an example in the section "Intro To Image Processing" that seems to be pretty close to what you are supposed to do for B.
how would i fix my code
You haven't solved anything because your tutor wants you to access the pixel array using loadPixels() NOT use tint() which hasn't worked anyway because you can't see the original image.
I suggest you look at the reference for the Processing commands your tutor expects you to use.
lines 27, 32 and 37 are the same. why is that?
and you don;t use the images in lines 12, 13, 14
actually, tint() does exactly what is required, although the one in line 31 looks wrong. but i think the task is to write them youself.