Thread: what's up with square files?

  1. #1
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905

    Lightbulb what's up with square files?

    I was just thinking, I was looking at someone's pic thing that we all get, the avatar, and i noticed they've got little notches on the four corners, so it's kinda like so:

    Code:
       __________
      /          \
     /            \
    |             |
    |             |
    |             |
    |             |
    |             |
     \            /
      \__________/
    -finally got those dang dimensions right, i hate these stupid spaces...

    and you see all that extra space there? imagine the picture was blown up a couple 1000 times, and those white spaces would then take up a LOT of space.

    Well, just a thought, I wonder if in the future if we will ever have "amorpheus" files. For instance, the file above wouldn't be a block, it would actually be molded around the data, and the blank space wouldn't be anything.......

    say you had a picture of a diamond with a corner in the middle of each side, with the normal file system, you'd have to waste ALL that space in the corners for nothing, whereas in the amorpheus system, it would just mold itself around the file's data, saving twice as much space almost!

    just my two cents....
    Last edited by jverkoey; 03-15-2003 at 11:29 PM.

  2. #2
    Registered User Scourfish's Avatar
    Join Date
    Mar 2002
    Posts
    387
    many picture formats already have transparent blitting
    -486SX-20
    -Some random Debian Distro
    -Some version of MS-Dos
    -Day of the Tentacle

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    I believe his point was, if you have a picture of a triangle, half of the picture contains the graphics and the other half is transparent, but still uses space in the bitmap. If a new filesystem was invented that, somehow, only stores the graphics data and not the transparent parts, you could save some filesize.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    one way would be to include the co ordinates of every pixel in its block
    Code:
    Color    Co Ordinates
    04h 08h  01h 00h 01h 00h
    but that would actually take up a lot more space than a bitmap. Another way, and perhaps the best way, would be to include some kind of shape definition in the header of the file.

  5. #5
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Try looking up vector graphics on google.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  6. #6
    ! |-| /-\ +3 1337 Yawgmoth's Avatar
    Join Date
    Dec 2002
    Posts
    187
    Another way, and perhaps the best way, would be to include some kind of shape definition in the header of the file.
    But that would only work with a predefined set of shapes. Anyway, with memory/storage so plentiful, we don't need to worry too much about wasted data.

    It's still a cool idea.
    L33t sp3@k sux0rz (uZ it t@k3s 10 m1|\|ut3s 2 tr@nzl@te 1 \/\/0rd & th3n j00 h@\/3 2 g3t p@$t d@ m1zpelli|\|gz, @tr0(i0u$ gr@mm@r @|\|d 1n(0/\/\pr3#3|\|$1bl3 $l@|\|g. 1t p\/\/33nz j00!!

    Speling is my faverit sujekt

    I am a signature virus. Add me to your signature so that I may multiply.

  7. #7
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> with memory/storage so plentiful, we don't need to worry too much about wasted data.

    I think the important point is not local storage, but bandwidth during transmission. Poor example I agree, (I wouldn't send such a thing as a bitmap), but assume I want to send you a bitmap which is 100x100 and contains one blue pixel, and the rest are transparent.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  8. #8
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    >>assume I want to send you a bitmap which is 100x100 and contains one blue pixel, and the rest are transparent.

    Here you go. Photoshop compressed it down to 158 bytes.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  9. #9
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>>Poor example I agree, (I wouldn't send such a thing as a bitmap), but assume

    ... yawn.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  2. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  3. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM
  4. C++ Checkers Game
    By SnS CEO in forum C++ Programming
    Replies: 9
    Last Post: 09-07-2005, 01:21 AM
  5. for loops using square roots, square, Cube
    By lotf in forum C Programming
    Replies: 3
    Last Post: 03-21-2004, 04:29 AM