I have a list of input images of which I'm trying to stack and get all the brightest pixels.
At the moment I'm reading the first file and setting that as the base file, if a pixel in the next read image is brighter then it overwrites the first base image bitmap.
It performs okay for low resolution images but larger images take much much longer as there can be 12,000,000 pixels in a 3000x4000 image.
Would it be better for me to read the files as some sort of array instead of storing them as a bitmap?
Speed is the essence here and I'm not too sure of how I can go about achieving the most efficient method to stack these images?
Thanks for your help!
At the moment I'm reading the first file and setting that as the base file, if a pixel in the next read image is brighter then it overwrites the first base image bitmap.
It performs okay for low resolution images but larger images take much much longer as there can be 12,000,000 pixels in a 3000x4000 image.
Would it be better for me to read the files as some sort of array instead of storing them as a bitmap?
Speed is the essence here and I'm not too sure of how I can go about achieving the most efficient method to stack these images?
VB.NET:
For Each Item As String In lbxFiles.Items
Dim newDrawing As System.Drawing.Bitmap = System.Drawing.Bitmap.FromFile(Item)
For xCount As Integer = 0 To imageWidth - 1
For yCount As Integer = 0 To imageHeight - 1
baseColour = baseDrawing.GetPixel(xCount, yCount)
newColour = newDrawing.GetPixel(xCount, yCount)
If newColour.GetBrightness >= baseColour.GetBrightness Then
newDrawing.SetPixel(xCount, yCount, newColour)
End If
Next yCount
Next xCount
Next
Thanks for your help!