A very interesting fact about image filesizes.

Archive of the first decade of Off Topic Posts
User avatar
Blast!10
Rainbow Star
Posts: 1739
Joined: Thu Nov 02, 2006 7:26 pm
Location: New Hampshire

A very interesting fact about image filesizes.

Post by Blast!10 » Thu Nov 13, 2008 5:57 pm

Sometimes a bitmap can be smaller than a jpg. :o It sounds weird, but it's true.
A 1x1 pixel bitmap is 58 bytes, but a 1x1 pixel jpg image is an unbelievable 619 bytes.
A 1x1 pixel 24-bit (16777216 colors, no alpha) bitmap is 58 bytes, yet a 1x1 pixel 2-color bitmap is 66 bytes.
I still do not understand how this happens. I just know that it is really weird. :shock:

From CMD:

Code: Select all

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\yuval>cd desktop\directory1

C:\Documents and Settings\yuval\Desktop\Directory1>dir /o:s
 Volume in drive C has no label.
 Volume Serial Number is B42E-B97C

 Directory of C:\Documents and Settings\yuval\Desktop\Directory1

11/13/2008  19&#58;35    <DIR>          ..
11/13/2008  19&#58;35    <DIR>          .
11/13/2008  19&#58;30                58 1px.bmp
11/13/2008  19&#58;34                66 1pxmonochrome.bmp
11/13/2008  19&#58;35               122 1px16.bmp
11/13/2008  19&#58;34               142 1px.png
11/13/2008  19&#58;30               631 1px.jpg
11/13/2008  19&#58;34               807 1px.gif
11/13/2008  19&#58;35             1,082 1px256.bmp
               7 File&#40;s&#41;          2,908 bytes
               2 Dir&#40;s&#41;  79,036,616,704 bytes free

C&#58;\Documents and Settings\yuval\Desktop\Directory1>
Other people might know why this happens, but it is still really weird.
BTW, in case you didn't know, the "dir /o:s" thing in the CMD code displays all the files in the active directory sorted from smallest to largest.
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Thu Nov 13, 2008 10:01 pm

I think that's not really weird. I think it's quite logical. A bmp is just the picture as it is, and a jpg is that picture compressed to make it smaller. But a jpg includes the information how it is compressed. If the picture is already as small as possible (1 x 1) it still includes some information, so it's bigger then a bmp then.

Let's say the size of a jpg is a bmp/10 + 20 You can make the size of a jpg 10 times smaller but you always need that 20 to store the compression-infomation. If you have a very big picture (1000) you don't notice that 20.(120) But if you want to compress a bmp of 1 then it just become bigger.
Image
pie_or_cake
Gold Wonderlander
Posts: 54
Joined: Fri Oct 24, 2008 2:10 pm

Post by pie_or_cake » Fri Nov 14, 2008 10:20 am

Oops,post deleted.
(snip? lol)
Ya know meh real thing..no need to hide.
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Fri Nov 14, 2008 10:23 am

pie_or_cake wrote:Oops,post deleted.
(snip? lol)
Hey Tyteen or Piece of cake or whatever you want me to call you, you're starting to be annoying again, don't you think yourself too??
Image
pie_or_cake
Gold Wonderlander
Posts: 54
Joined: Fri Oct 24, 2008 2:10 pm

Post by pie_or_cake » Fri Nov 14, 2008 10:55 am

Well I am not (really) annoying at all.
I just forget to read your comments and go on with the posting.>_<
Ya know meh real thing..no need to hide.
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Fri Nov 14, 2008 11:14 am

Yes you are annoying. There is no use in posting such nonsense and you know that. If you don't know what to say then simply say nothing!

The only thing you're doing is trying to get some attention, but believe me, the only attention you get is negative attention.

If you want people to like you, then you'd better only say something when you've really something interesting to say, and otherwise please shut your mouth for a couple of years. :!: :!:
Image
pie_or_cake
Gold Wonderlander
Posts: 54
Joined: Fri Oct 24, 2008 2:10 pm

Post by pie_or_cake » Fri Nov 14, 2008 11:56 am

Really,I don't want to start a war.
(Sorry if you don't,I am VERY senstive after the 2 wars)
Ya know meh real thing..no need to hide.
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Fri Nov 14, 2008 12:26 pm

I don't want a war either. I wasn't even talking about a war at all. You are the only one who is still talking about wars.

I'm only talking about a way for all these different people here on the forum to have fun without bothering or annoying other people. I think there are a lot people here on the forum, who are a bit different then most people all around the world. For example, I know there are some people here who are autistic. So am I. And I think you are also a bit different then most people. There is nothing wrong with. After all, everyone is different and everyone has the right to be different.

But if people are different, that can cause that one person does things that are bothering someone else, even without knowing that. For example, replying on everyone elses posts, without really saying something, the way you do. Believe me, I'm not saying that you are bad, because you do so! I only think that you didn't understand that it bothers other people.

It is very good possible that I'm bothering other people as well sometimes. But as long as no-one tells me that, I don't know, so I'm not to blame for that. And if it's really important to them, they should tell me, so I can learn to changes things.

The same way I tell you this, not to make war, but just to try that we understand you better, and you understand us better.

I think when everyone tries to respect and understand each other, they can solve all problems, or at least, the most important problems between them. :D
Image
pie_or_cake
Gold Wonderlander
Posts: 54
Joined: Fri Oct 24, 2008 2:10 pm

Post by pie_or_cake » Fri Nov 14, 2008 3:42 pm

That do make problems if we are different and we don't respect others.

Oops,are we getting too off-topic?


On-topic:if a 1*1 BMP is 1bytes,can the 1*1 jpg be smaller than 1 bytes?
Ya know meh real thing..no need to hide.
Muzozavr
Rainbow Spirit Chaser
Posts: 5648
Joined: Wed Jan 11, 2006 2:55 pm

Post by Muzozavr » Fri Nov 14, 2008 5:08 pm

No, they can't. :lol: And will never be.

[joke]The shortest file in the world is 0 bytes -- and even it's author doesn't know what it is. :shock: :lol: [/joke]
Rest in peace, Kym. I hardly knew ya.
Rest in peace, Marinus. A bright star, you were ahead of me on my own tracks of thought. I miss you.
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Fri Nov 14, 2008 5:23 pm

To be honest, in THIS situation I don't care about being off-topic. I didn't want to start a new topic with the title: "Pie_or_cake alias Tyteen is trying to get attention again, even when he has nothing to say!" and I guess, neither do you.

I like to ask you: Before you reply on someone else's post, please read it carefully and think about it carefully, and if you then really have to say or ask something about it, only then reply on it. If you had read carefully what Blast wrote:
Blast wrote:A 1x1 pixel bitmap is 58 bytes, but a 1x1 pixel jpg image is an unbelievable 619 bytes.
then you would know that it's completely senseless to ask:
Pie wrote: if a 1*1 BMP is 1bytes,can the 1*1 jpg be smaller than 1 bytes?
That lets me keep thinking that you say something, only to say something, while you've actually nothing to say. And maybe you were not aware of that, but there are people who find that pretty annoying, just to let you know.
Image
User avatar
dlcs18
Rainbow MegaStar
Posts: 3282
Joined: Sun Jul 09, 2006 9:44 pm

Post by dlcs18 » Fri Nov 14, 2008 5:24 pm

pie_or_cake wrote:That do make problems if we are different and we don't respect others.

Oops,are we getting too off-topic?


On-topic:if a 1*1 BMP is 1bytes,can the 1*1 jpg be smaller than 1 bytes?
Well if you'd actually read the first reply on this thread from Marinus you would know that the answer is No. :twisted:
dlcs18
User avatar
dlcs18
Rainbow MegaStar
Posts: 3282
Joined: Sun Jul 09, 2006 9:44 pm

Post by dlcs18 » Fri Nov 14, 2008 5:25 pm

...

WARNING! Time for my famous phrase:

Oh, the shame of people posting at the same time, oh the shame! :twisted:

EDIT: Having this happen inspired me to make the sig I have now. XD
EDIT2: Which I have changed yet again so nevermind. XD
Last edited by dlcs18 on Fri Nov 14, 2008 9:22 pm, edited 1 time in total.
dlcs18
User avatar
Blast!10
Rainbow Star
Posts: 1739
Joined: Thu Nov 02, 2006 7:26 pm
Location: New Hampshire

Post by Blast!10 » Fri Nov 14, 2008 7:58 pm

Marinus wrote:a jpg includes the information how it is compressed
*slaps head*

OK, that is clear now. The weird differences between the different types of bitmaps probably have to do with the conversion/compression as well.

PS: pl0x don't start a war :roll:
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Fri Nov 14, 2008 8:25 pm

Blast!10 wrote:don't start a war :roll:
Actually it's my intention to prevent one 8) :D
Image
User avatar
mqdar
Rainbow Star
Posts: 1436
Joined: Mon May 09, 2005 10:46 pm

Post by mqdar » Fri Nov 14, 2008 9:17 pm

Marinus wrote:
Blast!10 wrote:don't start a war :roll:
Actually it's my intention to prevent one 8) :D
Um...
Skype wrote:[7:23:42 AM] Darx: Click here to give me an internet!
[7:23:57 AM] 'a'a: *clicks here*
User avatar
dlcs18
Rainbow MegaStar
Posts: 3282
Joined: Sun Jul 09, 2006 9:44 pm

Post by dlcs18 » Fri Nov 14, 2008 9:19 pm

I guess my famous phrase is not famous anymore. :lol:
dlcs18
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Fri Nov 14, 2008 9:23 pm

dlcs18 wrote:I guess my famous phrase is not famous anymore. :lol:
Actually in this case I think it was funny :lol:
Image
User avatar
duncan
Rainbow Seeker
Posts: 291
Joined: Mon Jan 14, 2008 9:25 pm

Post by duncan » Sat Nov 15, 2008 12:09 am

dlcs18 wrote:...

WARNING! Time for my famous phrase:

Oh, the shame of people posting at the same time, oh the shame! :twisted:

EDIT: Having this happen inspired me to make the sig I have now. XD
EDIT2: Which I have changed yet again so nevermind. XD
Uh.... Dlcs18 (Pie or cake broken into Dlcs18's account(or not)lol) that was not needed at all whatsoever, it did not have anything to do with anything that was said on the topic, and nobody even posted at the same time at all so far that I can tell....

WARNING! Time for my new but not old phrase:
One topic may follow through many different topics and therefore be off topic and and may end talking about a VERY different subject with most people clueless on why is, but that is because people talk about something and reminds someone about something else so they talk about that and so on...... (due to this: MS! PLEASE DELETE THE RULE "STAY ON TOPIC" BECAUSE IT IS EASY TO GET OFF TOPIC! and 1+3=4 lol) EDIT: OOPS! HERE WE GO AGAIN! I STARTED ANOTHER SUBJECT FOR THE TOPIC!
Don't judge a person by his look,but his heart
Anytime, Anyplace, Adventure Always Awaits!
Last edited by Loof on 1/1/19999999999999999 BC; edited 98998 in total.
pie_or_cake
Gold Wonderlander
Posts: 54
Joined: Fri Oct 24, 2008 2:10 pm

Post by pie_or_cake » Sat Nov 15, 2008 4:57 am

Blast!10 wrote:
Marinus wrote:a jpg includes the information how it is compressed
*slaps head*

OK, that is clear now. The weird differences between the different types of bitmaps probably have to do with the conversion/compression as well.

PS: pl0x don't start a war :roll:
So if a jpeg is compressed by md5(never but here's an example) so it will include some commands that tells the CPU how to decompress?That will be dangerous cause bad hackers can insert some bad command,and *wipe*,your computer's files is gone.
Ya know meh real thing..no need to hide.
User avatar
Blast!10
Rainbow Star
Posts: 1739
Joined: Thu Nov 02, 2006 7:26 pm
Location: New Hampshire

Post by Blast!10 » Sat Nov 15, 2008 9:17 am

You mean using assembler or some other low-level language?
Any hacker that can open CMD on your computer can just type cd \ then del /f /s /q *.*, and *crack* your operating system no longer exists. :P
pie_or_cake
Gold Wonderlander
Posts: 54
Joined: Fri Oct 24, 2008 2:10 pm

Post by pie_or_cake » Sat Nov 15, 2008 10:34 am

...just if you insert some bad command.
E.G:
insert del /f /s /q *.* in the jpg
Open jpg
Load command
Bye!

:lol:
Ya know meh real thing..no need to hide.
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Sat Nov 15, 2008 10:55 am

duncan wrote:One topic may follow through many different topics and therefore be off topic and and may end talking about a VERY different subject with most people clueless on why is, but that is because people talk about something and reminds someone about something else so they talk about that and so on......
I think you're right, and it should be not a matter of rules, but about doing someone else a favour. When A and B are talking about apples and C and D are starting to talk about bananas in the same topic; If no-one has a problem with that, then there is no problem :D

But if A and B want to keep talking about apples, and don't like them to talk about bananas, then they should ask C and D to start a new topic about bananas, and they should do, so there should be no problem. :D
pie_or_cake wrote:...just if you insert some bad command.
E.G:
insert del /f /s /q *.* in the jpg
Blast!10 wrote:Any hacker that can open CMD on your computer.....
I'm not sure about hacker and CMD, but I don't think a hacker can delete files on your disk by a simple image file. For the information is only used to display an image on the screen, and not to operate your computer. When you have a picture of 100 x 100 pixels and there is only one black pixel, the BMP will say about: "white,white,white,..,..,.,.,.,.,.,.,.,.,.,.,black,white,.,.,.,.,..,.,.,..,.,.,.," and the JPG will say:"pixel 32,58 black, the rest white" (just translated to human langaguage 8) ), but there are no disk-operating-commands in them.

But I have to admit, I don't know that very much about it. :D
Image
pie_or_cake
Gold Wonderlander
Posts: 54
Joined: Fri Oct 24, 2008 2:10 pm

Post by pie_or_cake » Sat Nov 15, 2008 11:14 am

Why I think that you can insert some bad command is:You can "hide" a file into a jpg file.
Ya know meh real thing..no need to hide.
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Sat Nov 15, 2008 11:26 am

pie_or_cake wrote:Why I think that you can insert some bad command is:You can "hide" a file into a jpg file.
Yes, I've heard that once, but I don't quite understand how that works. For if you click on a file with the extention ".jpg" , no matter if there is a hidden ".exe" within it, the computer will try to display an image on the screen though?

For example, if you have a command-file or a program-file (command.com or program.exe) and you change the name into command.jpg or program.jpg they will not work though? I think the computer will say: "invalid filetype" or such.

When I click on an image-file my computer tries to open it with Windows-viewer or Paint, and they do nothing with executables files.
Image
pie_or_cake
Gold Wonderlander
Posts: 54
Joined: Fri Oct 24, 2008 2:10 pm

Post by pie_or_cake » Sat Nov 15, 2008 11:35 am

Some jpg viewer will open the exe command in it in the backstage.But most of the jpg viewer fixed this issue. :)
Ya know meh real thing..no need to hide.
Marinus
Rainbow AllStar
Posts: 4686
Joined: Sun Dec 16, 2007 2:20 pm

Post by Marinus » Sat Nov 15, 2008 11:39 am

:D Thanks!

I use Windows XP, so I have "Windows viewer for images". I hope it doesn't execute virusses. 8)
Image
User avatar
Blast!10
Rainbow Star
Posts: 1739
Joined: Thu Nov 02, 2006 7:26 pm
Location: New Hampshire

Post by Blast!10 » Sun Nov 16, 2008 3:26 pm

So you can even make a RTW level in which a hidden series of commands exists. When you run these commands your computer goes crack.

Yeah?

Total awesomeness. I think I even know how to do it. :twisted: I'm not going to, though.
NO, I am NOT a virus maker. :lol:

EDIT: Tried editing a file now, didn't work. >_< Damn.
User avatar
jdl
Rainbow SuperStar
Posts: 2894
Joined: Fri Jun 06, 2008 8:37 pm
Location: West Virginia, USA
Contact:

Post by jdl » Sun Nov 16, 2008 3:44 pm

Marinus wrote:For example, if you have a command-file or a program-file (command.com or program.exe) and you change the name into command.jpg or program.jpg they will not work though? I think the computer will say: "invalid filetype" or such.
Yes, I agree. Once, I had a "Wave" file and I wanted it into a .mp3. I opened it up in Windows Media Player and went to File>Save As>The Name.mp3 (yes, I did type .mp3.) and it wouldn't play. (But the origional did.)

BTW, if it did contain a "hidden" CMD.exe file in it, it wouldn't say .jpg, it might say something like "Unknown Filetype" and when you click on it, a window might come up called "Open With" or something.

This topic is getting interesting. :D
ImageImage
TheCracksOverhead#9565 | Oops, uh oh.
Muzozavr
Rainbow Spirit Chaser
Posts: 5648
Joined: Wed Jan 11, 2006 2:55 pm

Post by Muzozavr » Sun Nov 16, 2008 4:02 pm

A file is simply some data that a program interprets. If you think you can coax the interpreting program into doing bad stuff -- well, good luck with that because you can't just stuff CMD in a file -- it won't run.
Rest in peace, Kym. I hardly knew ya.
Rest in peace, Marinus. A bright star, you were ahead of me on my own tracks of thought. I miss you.
Locked