Recently I've started work on a project that deals with timages.
I was wondering if anyone could provide a function.
I'm looking to tile one timage across another Timage. Lets call them image1 and image2.
Image2 must be at least the size of image1. If it is not image2 must be resized to the size of image1. Now image1 has 17 subimages in the animation.
I hope I'm making sense.
Image1 is a dither pattern that is 4x4 pixels with 17 different fill patterns and image2 is a base picture. Basically I want to iterate through each 4x4 pixel section of the base image and replace it with one of the 17 dither patterns measuring 4x4 pixels. The problem comes in the dither pattern going "off the edge" of the base picture. The pattern chosen is determined by the average of all pixels in the 4x4 square. The grayscale version of each pixel in the 4x4 square is simply (red+green+blue)/3. This value is set for the red,green and blue. The 16 values then are averaged and divided by 255 to get the brush image pattern for the 4x4 square.
Here is the dither pattern it goes from pure black 0 to pure white 16.
This is the 17 image dither brush pattern.

The function should not modify the original image but rather return a new timage that is the original image with the 4x4 dithering applied.
I cannot work from the back buffer for this project. Image data must be done with pixel pointers.
I'm really sorry if you are lost. I tried to help as I asked for help. Please try if you think that you can help me with this.
Take a base picture that is atleast 4x4 pixels. Divide that up into 4x4 pixel blocks. Convert those blocks to grayscale by averaging their RGB components then setting all RGB values to that averaged color. Choose the proper subimage of the gradient pattern. Replace that block with the gradient pattern subimage.
I was wondering if anyone could provide a function.
I'm looking to tile one timage across another Timage. Lets call them image1 and image2.
Image2 must be at least the size of image1. If it is not image2 must be resized to the size of image1. Now image1 has 17 subimages in the animation.
I hope I'm making sense.
Image1 is a dither pattern that is 4x4 pixels with 17 different fill patterns and image2 is a base picture. Basically I want to iterate through each 4x4 pixel section of the base image and replace it with one of the 17 dither patterns measuring 4x4 pixels. The problem comes in the dither pattern going "off the edge" of the base picture. The pattern chosen is determined by the average of all pixels in the 4x4 square. The grayscale version of each pixel in the 4x4 square is simply (red+green+blue)/3. This value is set for the red,green and blue. The 16 values then are averaged and divided by 255 to get the brush image pattern for the 4x4 square.
Here is the dither pattern it goes from pure black 0 to pure white 16.
This is the 17 image dither brush pattern.

The function should not modify the original image but rather return a new timage that is the original image with the 4x4 dithering applied.
I cannot work from the back buffer for this project. Image data must be done with pixel pointers.
I'm really sorry if you are lost. I tried to help as I asked for help. Please try if you think that you can help me with this.
Take a base picture that is atleast 4x4 pixels. Divide that up into 4x4 pixel blocks. Convert those blocks to grayscale by averaging their RGB components then setting all RGB values to that averaged color. Choose the proper subimage of the gradient pattern. Replace that block with the gradient pattern subimage.