Hi Fernando, I agree with John. Also note >>
Each variable in PB also has a NULL indicator. Not sure how much memory is allocated per NULL indicator. For each bit of memory for the NULL indicators you "lose" another 78 MB memory.
625 MB of raw image data is a LOT of image. At 32 bits/pixel it is 156+ megapixels.
(Remaining text: When I mention C# it might as well be any other programming language where you can do math without NULL handling)
PowerBuilder's data type for binary data en masse is BLOB.
PB code (forced to do NULL-checking for every calculation) will run slower than null-free image processing in C#.
C#'s data type byte [ ] is similar to PB's BLOB. And you have data types like Span<T> and immutable structs to do highly optimized image processing.
I suggest move image processing to a faster language (like C#) and pass data back and forth as appropriate.
HTH /Michael
I'm wondering why this task is even needed. Depending on the requirements, a dedicated image processing component might be needed.