+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Help with C# file output compression.

  1. #1
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,628
    Blog Entries
    1

    Default Help with C# file output compression.

    Ok, so I made this C# program that makes text files of pixel data used to load images into the digital screen using E2 file functions. My problem is that I cant get all the pixel data of a picture more than 96x96 resolution without exceeding the file upload limit which is 100kb.

    The code it produces from the program outputs the colors of every pixel to the text file like this:
    Code:
    130,104,45
    130,104,35
    129,104,49
    127,104,49
    128,104,42
    131,101,47
    130,102,52
    127,104,50
    This is just basic R,G,B format. Now what I am hoping to get from someone is a more efficient way, or a compression algorithm I can use to pack all this pixel data from pictures up to 256x256 without exceeding 100kb. Any ideas?

  2. #2
    Wiremod Helper Donkie's Avatar
    Join Date
    May 2008
    Location
    Sweden
    Posts
    1,656

    Default Re: Help with C# file output compression.

    GLon?
    Get out. Seriously, do it.

  3. #3
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,628
    Blog Entries
    1

    Default Re: Help with C# file output compression.

    Someone suggested to me earlier, converting all the bytes to char's in the C# program, then in E2 using toByte(Char) to remake them. Would that reduce filesize considerably?

  4. #4
    I think I think too much -HP-'s Avatar
    Join Date
    Feb 2009
    Location
    Behind you with a very sharp knife.
    Posts
    2,466

    Default Re: Help with C# file output compression.

    base 36 is e2 compatible

  5. #5
    ◕␣◕ McLovin's Avatar
    Join Date
    Sep 2008
    Location
    Batman, Turkey
    Posts
    2,323
    Blog Entries
    3

    Default Re: Help with C# file output compression.

    Glon would use even more characters. If you don't mind the color quality deficit I would suggest dividing each 3 digit value and making them so each color can fit into a double digit number, and maybe get rid of the commas.
    Anticept - HP you are terrible at trolling. Always have been. Leave it up to the pros like Jat.
    Black Phoenix - Actually cunt goes into bullshit. Bullshit does not fit in cunt.
    Drunkie - Logically, Jat Goodwin must be a fist pumping guido.

  6. #6
    Developer Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    3,109

    Default Re: Help with C# file output compression.

    Save as hex, separate by \n?
    Code:
    FF04A2
    F3F2FF
    Should almost double the amount of pixels.
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr

  7. #7
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,628
    Blog Entries
    1

    Default Re: Help with C# file output compression.

    Quote Originally Posted by Matte View Post
    Save as hex, separate by \n?
    Code:
    FF04A2
    F3F2FF
    Should almost double the amount of pixels.
    Thanks, I'm going to try converting it into hex, and see what that produces.

  8. #8
    Wire Sofaking Wizard of Ass's Avatar
    Join Date
    May 2009
    Location
    Germany Bremerhaven
    Posts
    1,044

    Default Re: Help with C# file output compression.

    I was just about to say that.
    I think its the best methode to compress your pixel data.
    But i think a "," would be the best to seperate it.
    seriously getting serious

  9. #9
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,563

    Default Re: Help with C# file output compression.

    Use pallete and reduce colors (probably in external editor, like photoshop)
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  10. #10
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,628
    Blog Entries
    1

    Default Re: Help with C# file output compression.

    I changed it to use hex, and it outputs like this.

    Code:
    DD9A05
    D69300
    D89500
    D89500
    D59200
    D69000
    Which indicates it worked properly, but the image resolution was set to 128x128 and its a 144kb file wtf.
    It didn't compress much :angry:

    Quote Originally Posted by Black Phoenix View Post
    Use pallete and reduce colors (probably in external editor, like photoshop)
    I'll have to try that next, but my main goal was to make it work universally with any jpeg or bitmap, you just import the pic, select your resolution size, and it makes a compatible E2 file.

+ Reply to Thread
Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots