Reputation: 43
Server settings:
Protocol = tcp
socket type = stream
buffer = 9mb
Would it be faster to send the bytes of an Image type or the bytes of an array RGB values for each pixel?
an image that is 2 x 2 in size would be sent like this. for example
Array = [
RGB(1,1,1),
RGB(1,1,1),
RGB(1,1,1),
RGB(1,1,1)
]
Sending the data as fast as possible is an absolute need. The actual images i am sending are about 3840 x 2160 in size estimating in a rough 8mb.
another question that would help me find the answer to this would be:
Which data type is larger in bytes an image converted to bytes or an array containing RGB values of each pixel converted to bytes?
Upvotes: 0
Views: 62
Reputation: 100527
Content does not impact speed of data transfer (except potentially some modems protocol with compression, but unlikely to be of any concern now).
Just send whatever format that is represented in smaller number of bytes and works for you. Most image formats are already compressed, so likely sending image would be faster than unpacked raw data.
Upvotes: 1