Image Sending new Technique Suggestion!
Muhammad Intsab Haider
Technical Lead || Google Certified Android Developer || Mobile Developer || Working in Tamm
Some times we don't have knowledge to discuss about something but we have some questions in our mind who makes us worry..
As in my Childhood i had a Question: If really Earth is round like Ball then there must be any country exactly under our feet on other-side of ball
Why the people of that country don't fall down as they are on bottom side of ball and we are on top side of round ball???
So as a child of the field of programming i have a problem with existing sending image techniques in chat :D
-> Problem Statement is when we chat on Facebook or any other social network and send an image it takes 2,3 seconds sometimes to transfer and maybe more if network is slow.. And at the same time if we send message of 1000 words it takes less than a second in same network speed...
As Mobile App Developer if i take example of IOS Lets see code for Uploading
NSData *imageData = UIImageJPEGRepresentation(imageToSend, 0.5);
[self uploadImage:imageData]; // Uploading logic in this method
and if we debug the App and see the value of imageData may be like this { ffd8ffe0 00104a46 49460001 01000048 00480000 ffe10058 45786966 00004d4d }
My Question is why don't we send image data as String in message and reconvert it on receiver's end again into image. Rather than uploading the file on server and fetch it back on receiver side??? It will take lesser time to transfer and less involvement of network side effects because we saw string message take lesser time as compare to file to send..
For example we sent data {TAG_IMAGE 00111 01001 010 0000 10000 130002 39 } with a tag that will tell system that its not text message its image so that application can show loading image in chat box... and meanwhile system locally convert that binary string received back to the Image File..
Again I apologies from the experts of this field because i also feel annoying if someone replies Answer of difference between ifelse and elseif statement that
"The difference between ifelse and elseif is that in ifelse (If statement execute first otherwise else) while in elseif ( else statement execute first otherwise If) :D :D "
Full Stack Expert & Team Leader | Building Scalable, Cloud-Optimized Solutions with .NET & Azure
5 年Interesting observation, Intesab Bhai. However the binary number mentioned above does not represent an image. In a grayscale (black and white) image, a pixel is represented by 8 bits, 8 bits range from 0 to 255. This means that the B&W image can have a pixel value ranging from 0 to 255. In a colored (RGB) image, a single pixel means 3x8bits. Therefore, the higher number of? pixels, the higher the quality of the image and vise versa. Try sending an image on WhatsApp. The image is sent comparatively fast. This is because WhatsApp reduces the pixel quality, reducing the size of the image. Back to the point, the binary number shown above could be the key of the image saved on a server. The key just helps fetching the image rather than converting it. We are currently doing some research on High Efficiency Video Coding (HEVC). HEVC combined with deep learning helps in tracking object and processing the video frames in such a way that the tracked object is streamed/transmitted in high quality whereas the rest of the? image is of low quality. Hope this helps :)
Google? Certified Professional (Android - PMP) | Tech Lead Android | iOS | Mentor |
7 年Sure Bro anytime ping me. Tc
Google? Certified Professional (Android - PMP) | Tech Lead Android | iOS | Mentor |
7 年I am impressed Intsab, have you tested this thing using different techniques? Don't rely on others, go for it, let me know if you need any help from my side? Once we prove this thing we will pitch this idea to official websites, as we are working on open source platforms (Kotlin and Swift), we can add our code to next releases. I appreciate you on writing a very nice article. I hope we will discuss more things in future.