+ 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
    <title>eh?</title>


    Drunkie is a jewel in the rough Drunkie is a jewel in the rough Drunkie is a jewel in the rough Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    2,410

    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?
    Tutorials: Wire GPU | 3D Projections

    Black Phoenix: drun KIE
    Black Phoenix: PLEASE CONFIRM THIS MESSAGE DRUN KIE
    Drunkie: confirmed
    Black Phoenix: THE INTERGALACTIC CONTINIUM WANTS DRUN KIE TO GO ON A SPECIAL MISSION
    Black Phoenix: this will be AN EASY mission TO THE UNKNOWN AND beyonD
    <HP> ... I can't believe I'm talking to a fucking script at 4 am

  2. #2
    Wire Sofaking Donkie is on a distinguished road Donkie's Avatar
    Join Date
    May 2008
    Location
    Sweden
    Posts
    1,181

    Default Re: Help with C# file output compression.

    GLon?
    Hurr

  3. #3
    <title>eh?</title>


    Drunkie is a jewel in the rough Drunkie is a jewel in the rough Drunkie is a jewel in the rough Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    2,410

    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?
    Tutorials: Wire GPU | 3D Projections

    Black Phoenix: drun KIE
    Black Phoenix: PLEASE CONFIRM THIS MESSAGE DRUN KIE
    Drunkie: confirmed
    Black Phoenix: THE INTERGALACTIC CONTINIUM WANTS DRUN KIE TO GO ON A SPECIAL MISSION
    Black Phoenix: this will be AN EASY mission TO THE UNKNOWN AND beyonD
    <HP> ... I can't believe I'm talking to a fucking script at 4 am

  4. #4
    I think I think too much

    -HP- has a spectacular aura about -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
    2,239

    Default Re: Help with C# file output compression.

    base 36 is e2 compatible

    if you sign up using my link you get extra space!

    also this

  5. #5
    A Hologram
    McLovin is a jewel in the rough McLovin is a jewel in the rough McLovin is a jewel in the rough McLovin is a jewel in the rough McLovin's Avatar
    Join Date
    Sep 2008
    Location
    NY US
    Posts
    1,029
    Blog Entries
    2

    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.
    Filipe - you never know what ends up in your love hole
    Poonage - It's not a disorder, it can be solved
    Drunkie - vista was on the trail of complete beauty and perfection
    Omicron - cable management is for losers, and people who know what they're doing
    Drunkie - me and solece have tickets to go see justin bieber, i'm looking forward to it
    JatGoodwin - I don't normally suck dick, but when I do they call me immibis
    Drunkie - THERE IS SIMPLY NOT ENOUGH DICKS
    JatGoodwin - stand back, im going to do science

  6. #6
    Wirezard

    Matte is just really nice 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
    3,151

    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


    Wire FPGA

  7. #7
    <title>eh?</title>


    Drunkie is a jewel in the rough Drunkie is a jewel in the rough Drunkie is a jewel in the rough Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    2,410

    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.
    Tutorials: Wire GPU | 3D Projections

    Black Phoenix: drun KIE
    Black Phoenix: PLEASE CONFIRM THIS MESSAGE DRUN KIE
    Drunkie: confirmed
    Black Phoenix: THE INTERGALACTIC CONTINIUM WANTS DRUN KIE TO GO ON A SPECIAL MISSION
    Black Phoenix: this will be AN EASY mission TO THE UNKNOWN AND beyonD
    <HP> ... I can't believe I'm talking to a fucking script at 4 am

  8. #8
    Wire Sofaking Wizard of Ass has a spectacular aura about Wizard of Ass has a spectacular aura about Wizard of Ass's Avatar
    Join Date
    May 2009
    Location
    Germany Bremerhaven
    Posts
    1,068

    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 has a spectacular aura about Black Phoenix has a spectacular aura about Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,273

    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
    <title>eh?</title>


    Drunkie is a jewel in the rough Drunkie is a jewel in the rough Drunkie is a jewel in the rough Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    2,410

    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.
    Tutorials: Wire GPU | 3D Projections

    Black Phoenix: drun KIE
    Black Phoenix: PLEASE CONFIRM THIS MESSAGE DRUN KIE
    Drunkie: confirmed
    Black Phoenix: THE INTERGALACTIC CONTINIUM WANTS DRUN KIE TO GO ON A SPECIAL MISSION
    Black Phoenix: this will be AN EASY mission TO THE UNKNOWN AND beyonD
    <HP> ... I can't believe I'm talking to a fucking script at 4 am

+ 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
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots