Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

help with image

Name: Anonymous 2007-05-28 19:28 ID:3Qd527IF

dear /prog/

an image is like a matrix of pixels

i want to blur a portion of the image, so i receive x (int) and y (int) with is the starting point of the image, then I receive width (int) and length (int) to mark the portion to be blurred.

but then the program receives also a variable called 'size' (int), which divides the portion in squares with 'size' of side. in order to blur the image, i must make the average of all the pixels in that square, and make the square with that value of color.

i already made the functions that detect the red, green and blue of a pixel [red(x,y)blue(x,y)green(x,y)] and the functions that write a color to a pixel color(r,g,b,t,x,y).

but i'm having troubles to handle the squares and the matrix of pixels, looks messy. there's like, a fuckload of fors and whiles, no?

can you help me? thanks, adojan

Name: Anonymous 2007-05-29 0:26 ID:dni2CAGZ

but i'm having troubles to handle the squares and the matrix of pixels, looks messy. there's like, a fuckload of fors and whiles, no?
Fuckload? You'd need at most 2 for loops to loop through your area. Also, putpixel-functions are pretty enterprise. Since you have an array of pixels do it inline.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List