Results 1 to 19 of 19

Thread: Image Compression for Data Transfer

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    11

    Question 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?

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Image Compression for Data Transfer

    how about put it in a zip file and send that, then unzip it at other end
    Chris

  3. #3
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Image Compression for Data Transfer

    What type of image file is it? if its jpg or gif they should be fairly small anyway
    Chris

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    11

    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)

  5. #5
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Image Compression for Data Transfer

    Why will it be choppy?
    Chris

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    11

    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)

  7. #7
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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
    Chris

  8. #8

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    11

    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.

  9. #9
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  10. #10
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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
    Chris

  11. #11

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    11

    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.

  12. #12
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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?
    Chris

  13. #13

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    11

    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>

  14. #14
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  15. #15

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    11

    Re: Image Compression for Data Transfer

    Right on. Which image compression would you suggest?

  16. #16
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  17. #17
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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
    Chris

  18. #18

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    11

    Lightbulb 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.

  19. #19
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Image Compression for Data Transfer

    Yea i would try what you said and see if it is suitable
    Chris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width