Image Compression for Data Transfer
I'm not sure if this is the right section to post this in, but I guess it's as good as any.
I want to compress a webcam image to transfer it over the p2p network I'm designing, although I'm not sure of the best mothod to accomplish this. It would have to be a reversable compression, so the image can be exploded into a readable format after transfer. Any ideas?
Re: Image Compression for Data Transfer
how about put it in a zip file and send that, then unzip it at other end
Re: Image Compression for Data Transfer
What type of image file is it? if its jpg or gif they should be fairly small anyway
Re: Image Compression for Data Transfer
I was thinking Jpeg, But it's for a webcam. If I don't buffer the images somehow It'll be choppy doing zip decompression (although methinks I might try zip anyway)
Re: Image Compression for Data Transfer
Re: Image Compression for Data Transfer
In theory, because of the time it takes to decompress the image and display it prior to a new frame arriving. (unless they are buffered)
Re: Image Compression for Data Transfer
Ah I see, so your getting the image from the webcam and sending it to remote side? For this I would try a socket using the UDP (user datagram protocol) where theres no connection required, it will be a lot quicker than TCP so it will look smoother
Re: Image Compression for Data Transfer
but the thing is, each of the clients in the program are issued a session id (and I do this so the program doesn't end up like Y!Messenger back in early 02') upon logging in, so i think it has to be connection dependant protocol. I dunno, but I do appreciate your thoughts on this matter.
Re: Image Compression for Data Transfer
Compression is part of almost all image protocols - you should not want to compress the file but instead select a compression scheme with the image datatype you are using and understand what that will give you...
Lossy compression - not lossy compression - many, many factors.
Re: Image Compression for Data Transfer
I wouldnt use any compression, I would just transfer the raw file, if you compress each frame before sending, then decompress at the client before showing, it will be slow and laggy/choppy. There shouldnt be a problem with the file size as its fairly small for a web cam viewer image anyway.
do you save the image to a disk before sending? or does it literally just grab the image from the cam
Re: Image Compression for Data Transfer
exactly, that is what I had predicted would happen. I guess I will just send raw image data, although I was hoping to improve on the looks of the low-speed connection webcam users. Oh well, if it works it works.
Re: Image Compression for Data Transfer
For the low speed users, cant you grab a smaller resolution/lower quality image from the webcam, which will speed it up?
Re: Image Compression for Data Transfer
well yah, that's the normal method - but that is kind of what I was trying to avoid. <shrugz>
Re: Image Compression for Data Transfer
Which was exactly my point...
Select a level of compression that is part processing the image.
Usually you cannot get "smaller" image data by compressing with something like zip. Usually to get smaller image data you need to sacrifice something - quality - color levels...
Re: Image Compression for Data Transfer
Right on. Which image compression would you suggest?
Re: Image Compression for Data Transfer
What gets exposed to you when you read the image in VB? Are you using API or DLL calls that came with the webcam?
What is the make of the webcam?
Re: Image Compression for Data Transfer
I dont understand why you dont just send the raw jpeg data by the time its endoded the entire file in a compression system, then decoded at the other end, it will of defeated the purpose of using compression since the file probably could of been sent without compression quicker than with it
Re: Image Compression for Data Transfer
You're probably right, although I think i'm going to give the dial-up clients the ability to buffer their images a few seconds with higher res images, or if not use lower res with no buffering. Dunno, that's why I posted the question here. Looking for the best method to accomplish this task, since it's my first attempt at streaming images between clients.
Re: Image Compression for Data Transfer
Yea i would try what you said and see if it is suitable