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

Thread: Help with C# file output compression.

  1. #1
    Wire Sofaking Drunkie will become famous soon enough Drunkie will become famous soon enough Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    754

    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
    Wire Sofaking Donkie is on a distinguished road Donkie's Avatar
    Join Date
    May 2008
    Location
    Sweden ofc
    Posts
    639

    Default Re: Help with C# file output compression.

    GLon?
    Hurr

  3. #3
    Wire Sofaking Drunkie will become famous soon enough Drunkie will become famous soon enough Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    754

    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
    no brain, no headache

    -HP- has a spectacular aura about -HP- has a spectacular aura about -HP-'s Avatar
    Join Date
    Feb 2009
    Location
    Behind you with a very sharp knife.
    Posts
    1,225

    Default Re: Help with C# file output compression.

    base 36 is e2 compatible
    sry 4 my bad spelign, but enligh is my 2 langage



  5. #5
    Wire Sofaking
    IamMcLovin will become famous soon enough IamMcLovin's Avatar
    Join Date
    Sep 2008
    Posts
    601

    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.
    Projects:
    - E2 Holograms
    - E2 File Loading
    - E2 HUD Rendering
    - YouTube Player

    Working On:
    - My Radio
    - Zero G
    - GMedia

    <Filipe> you never know what ends up in your love hole
    Poonage - "It's not a disorder, it can be solved"

  6. #6
    Wirezard


    Matte is just really nice Matte is just really nice Matte is just really nice Matte is just really nice Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    2,100

    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
    Wire Sofaking Drunkie will become famous soon enough Drunkie will become famous soon enough Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    754

    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 will become famous soon enough Wizard of Ass will become famous soon enough Wizard of Ass's Avatar
    Join Date
    May 2009
    Location
    Germany Bremerhaven
    Posts
    821

    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 will become famous soon enough Black Phoenix will become famous soon enough Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    2,742

    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
    Wire Sofaking Drunkie will become famous soon enough Drunkie will become famous soon enough Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    754

    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

    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
1 2 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