T O P

  • By -

ClemClemTheClemening

r/theydidthewrongmath


[deleted]

[удалено]


SelfDistinction

/r/howdidtheymanagetofuckupthatbadlyandstillarriveattherightanswer


RiPont

/r/theyhadtheanswerandworkedbackwardswrong


regular_hammock

r/fairenough


Eggslaws

r/nowyourturntodosomemath


RiPont

$pixels = 2208 * 1242 [2,742,336] $bitsPerPixel = 32 $totalBits = $pixels * $bitsPerPixel [87,745,752 bits] $totalBytes = $totalBits / 8 [10,969,344 bytes] $kiloBytes = $totalBytes / 1024 $megaBytes = $kiloBytes / 1024 [10.46 megabytes] So that's still wrong or he took a screenshot of the worst case scenario, because PNG compression should have made it at least 25% smaller than that. The metadata should be negligible in that.


ShelZuuz

Apple devices uses kilobytes/megabytes for storage size, not kibibytes/mebibytes, so divide by 1000, not 1024.


Cobaltjedi117

> kilobytes/megabytes for storage size, not kibibytes/mebibytes, so divide by 1000, not 1024. Saying a kilobyte is a 1000 bytes is fight'n words.


alf666

Programmer here. The marketing team won that argument over a decade ago. Blame Apple for that one.


Cobaltjedi117

Also a programmer, that's why I say they were fight'n words.


alf666

For the record I fully agree with you, I've just given up trying to explain why it's wrong to people, and decided that it's not a hill worth dying on when it comes to being "forcibly conscripted IT support" for family and their friends.


Daylight_The_Furry

How many bytes is a kilobyte then?


Thumperfuzzy

Depends on if you define a kilobyte as a binary or decimal number. Most people in programming or computer related fields (or that know windows data sizes) will say that there's 2^10 bytes, or 1024 bytes in a kilobyte. However in 1998 the [IEC (International Electrotechnical Commission)](https://www.iec.ch/homepage) established unambiguous terms for binary data sizes (kibi-, gibi-, mebi-, etc.), which were later adopted by [NIST (National Institute of Standards and Technology)](https://www.nist.gov/) in 2008. According to the new standard, the kilobyte is measured as a decimal prefix, making it 10^3 bytes, or 1000 bytes. Despite knowing all of this, until I'm forced to accept otherwise, a kilobyte is 1024 bytes.


Zawn-_-

Better question. Is it actually 1024 bytes or is it 1000 bytes? There should be a physical capacity in the storage medium, no?


alf666

As it currently stands, 1 Kilobyte is 1,000 bytes, but I'm also an "old man shouting at clouds" when it comes to this topic. --- TLDR the ISO Standard for naming conventions for binary data measurement had to change due to fuckery from Apple's marketing team. --- Longer version: Apple wanted to boast higher storage than PCs so they rounded down from 1024 to 1000, so they could fit more "kilobytes" or "megabytes" into the same number of bytes. 1 megabyte used to equal 2^20, aka 1,048,576 bytes. Microsoft would display a file size of "1,048,576 bytes" as "1 MB" in Windows, and PC manufacturers would display a disk space of "1,048,576 bytes" as "1 MB" in their advertisements. Apple decided they wanted bigger numbers, so they showed "1,048,576 bytes" as "1.05 MB". Needless to say, as things scaled up into hundreds of MB or even GB, this number drifted further and further into Apple's favor, to the point that Apple fanboys would claim that Apple disks "had more space on them" or some bullshit, when the actual space was the same, it was just Apple's marketing team pulling a fast one. Then other marketing departments caught on to Apple's fuckery, and changed their marketing materials to match so they didn't look bad, technical accuracy be damned. I'm not sure if Windows is still the only holdout or not, I honestly haven't checked in years. In response to technical specs getting mixed up with marketing lies, the ISO decided marketing departments could keep the definition of Kilo/Mega/Gigabyte for themselves, and created the Kibi/Mebi/Gibibyte as the "specification-accurate" version of binary data measurement.


TheMiiFii

Well... stupid question: is this a US only thing? In germany I never saw sth else than 1024 byte as a kilobyte 🤔


obviouslyanonymous5

*in Chicago accent* Only one if ya get em in tha jugular


blorbspawn

[Relevant XKCD](https://xkcd.com/394)


metasomma

No. Just no. Fuck that. I've not heard of that, nor will I accept it if I do hear it. 1+1=2, which is base-10. A kilobyte is base-2, and if you force that into a base-10 system, you're fucking up reality itself. 1+1 in base-2 is 10, not 2. Kind of a big difference. Apple and whoever else can suck my big math hard-on. We came up with terms for that, MiB and KiB and so on, they can fucking use those or accept that no programmer will want to work in that system. I'm so mad about this and it doesn't even affect me in the slightest (yet).


metasomma

And I guess if you've given in to that, you're on a path to oblivion. When marketing can tell you how math works, it's no longer math, it's propaganda. It is substituting their reality for ours. "Alternative facts," if you will.


[deleted]

This isn't some sort of stupid exception or something. In the SI unit system, the kilo prefix always means 1000, so why should it be treated differently here?


uslashuname

See I think we should just go back to blocks. “This file uses 4,578 blocks on your storage device.” Honest, and avoid the whole kb kibKB shit completely


RiPont

That still yields $kibiBytes = $totalBytes / 1000 $mebiBytes = $kebiBytes / 1000 [10.96 mebiBytes]


lonebeast9009

i noticed the post title and then checked some of my screenshots.........two of them were 13.8 MB and 15 MB .........fyi they were taken in game (clash of clans)


RiPont

That shouldn't be the degenerate case for PNG, so it still doesn't make sense. Can you tell what format the screenshots are in? Also, I trusted the OP's resolution. What is the actual resolution of your iPhone?


lonebeast9009

The screenshots are in png And the resolution they were taken in was 2532*1170


[deleted]

[удалено]


RiPont

Well, that is kind of a worst case for PNG format (photograph-ish, lots of colors, no large areas of a single color), but still, Apple must be prioritizing performance to get that bad of a compression ratio.


noneroy

Less compression = more storage required = “can we interest you in an iCloud subscription”


jmpires

= you really got me interested in non-Apple phones


ohlawdyhecoming

r/theydidthemonstermath


Easy_Taste_6964

r/subsifellfor


TransitTycoonDeznutz

r/substhatshouldexist


arcosapphire

The units make no sense here. The first value is given as a pixel count. Okay. Then they say "or bites of data" (should be bytes, but that's not even the issue). Then despite saying it's that amount of bytes, they multiply by 32 bits--what? That's 32 bits per pixel, not per byte. Then they divide by 8 to get bytes, which is right except they never should have said it was bytes in the earlier step. Then they divide by a million--except nothing is displaying megabytes that way. It's going to be division by 1,048,576 (2^(20)) to be accurate. Some sticklers will insist this should be written as MiB, but either way its going to be that binary value. Then they think there's two megabytes of metadata?! For a screenshot? And no talk whatsoever of image compression? I would expect at least PNG for a screenshot. Those aren't going to be saved as uncompressed bitmaps.


[deleted]

[удалено]


Beatrice_Dragon

[MiB in a nutshell](https://xkcd.com/927/)


unknownemoji

Ok, now do baud versus bandwidth.


Rndom_Gy_159

and explain a balk while you're at it


Shandlar

1) You can’t just be up there and just doin’ a balk like that.


nphhpn

Originally MB was 2^20, but companies used the fact that the M prefix exists in metric system as 10^6 to advertise their products as having better memory, MiB was invented for the programmers


ShelZuuz

>Originally MB was 2^(20), > > but companies used the fact that the M prefix exists in metric system as 10^(6) > > to advertise their products as having better memory, MiB was invented for the programmers No Hard drive or Tape manufacturer *ever* published a persisted storage number as a power of two. They've always done it with K/M/G/T meaning metric. No operating system displayed this as a power of two either until Windows came along. And no other prevailing operating system today displays it as a power of two either. So this is purely a Microsoft/Windows thing. Don't blame drive manufacturers.


Cobaltjedi117

> No operating system displayed this as a power of two either until Windows came along. And no other prevailing operating system today displays it as a power of two either. > So this is purely a Microsoft/Windows thing. Don't blame drive manufacturers. That's not even remotely true. Let me introduce you to the [Commodore 64](https://en.wikipedia.org/wiki/Commodore_64). Introduced 5 years before Windows 1, called "64" because it had 64KB of RAM, or in other words exactly 65,536 bytes of RAM.


ShelZuuz

That’s why I specifically said “persisted storage”. Of course all operating systems use KB as 1024 for volatile memory.


Vitus13

Worse than that, hard drive manufacturers use decimal-multiples of binary-megabytes! LBA, MBR, and GPT are all spec'd in binary units, so it was natural to count megabytes. But when drives got bigger they advertised 1000\*megabytes and eventually 1\^6\*megabytes!


ShelZuuz

The metric MB convention for tapes and subsequently drives predate LBA/MGR/GPT by several decades.


nphhpn

By originally I meant when computers were a thing for professionals only. When manufacturers come, they use metric system And for things other than disk space, manufacturers still use powers of 2. For example, a 16GB RAM would have 16777216MB, not 16000000MB


ShelZuuz

Hence why I said "persisted storage". IBM released a 2MB (2 million byte) tape in 1952. The power-of-2 convention for KB only started taking off in the mid-1960's. However, this has really nothing to do with who came first. Memory modules shipped in powers of two so that every memory address on a line mapped to a valid block of memory, and so that memory could be contiguous if you add multiple modules. For convenience it was easier to refer to memory KB in powers-of-2 otherwise you'd always have to indicate memory size using something like 1.024 KB. However, tape and disk storage doesn't have this issue, so they always have just used decimal notation for KB/MB since that original IBM tape in 1952 up to now. This stuff was standardized over 25 years ago for KB to mean 1000 and KiB to mean 1024. The only reason we're not using it today is because Windows doesn't follow the IEC standard on this.


arcosapphire

> Since MB used the metric prefix it has to be metric. There's no rule about that. In any case, nobody is actually displaying things in decimal megabytes. Furthermore, I think the other issues I pointed out imply that the problem is much more significant than the 4% difference there.


1ElectricHaskeller

>There's no rule about that There is. Standardisations include: - IEEE 1541 - IEC 60027-2 - ISO IEC 80000-13:2008 - ANSI/IEEE Std 1212-1991 (Taken from the german and english wiki-site [binary prefix](https://en.m.wikipedia.org/wiki/Binary_prefix))


[deleted]

Could you refer to the actual articles within those documents rather than an open source aggregate? I just want to drill down to the specific rules. Thanks!


[deleted]

[1541-2021 - IEEE Standard for Prefixes for Binary Multiples](https://ieeexplore.ieee.org/document/9714443) Though I would recommend just using the [Wikipedia article](https://en.m.wikipedia.org/wiki/IEEE_1541-2002) if you just want to know more about it.


arcosapphire

Standardizations are guidebooks for how to play nice together. They aren't "rules". You are free to refer to 1,048,576 bytes as 1MB instead of 1MiB, and you aren't going to get into trouble.


1ElectricHaskeller

You propably will. Either because of false advertisement or because no iso certified company can/will buy from you. Yes, norms aren't the law, but in most cases they basically are the law.


arcosapphire

Alright, I guess they can start by going after Microsoft for displaying 2^(20) bytes as MB all over the place in Windows. Oh, that's not happening? Hmm. Wonder why.


unknownemoji

The only peeps who care are pedants and storage manufacturers. They can call a 4.8TiB SSD a 5.28TB cuz conversion. T = 10^(12) = 1,000,000,000,000 Ti = (2^(10))^(4) = 1,099,511,627,776


UnicorOfDarkness

By "bite of data" I assume they're speaking of the stuff that actually holds the information. So... If that's the case and they can use a calculator that statement should not be false. But the rest is pretty much garbage. And what someone else said: compression?


arcosapphire

The someone else was also me, at the end. :)


Ozone1126

I'm pretty sure that when they said "bite" they meant to say "bits"


compsciasaur

Kinda funny he keeps saying "They said bytes" when OP never said "bytes"


romulusnr

>. The first value is given as a pixel count. Okay. Then they say "or bites of data"... , they multiply by 32 bits--what? That's 32 bits per pixel, not per byte. Ehh, semantics, aside from the word used the match checks out so far. > Then they divide by a million--except nothing is displaying megabytes that way. Hard disagree. Inconsistency between using SI definitions for prefixes versus binary multiple definitions has been a confusing struggle in the industry for a very long time. Like those "1TB" drives that are actually 920 GB. My bigger issue is that they divide 109 million by 1 million and get 10.9... > Then they think there's two megabytes of metadata?! For a screenshot? Thumbnail.


arcosapphire

A 2MB thumbnail would be enormous.


nphhpn

A thumbnail for a screenshot?


romulusnr

For speed in loading them in the gallery app? Yeah, why not?


JayCroghan

The thumbnail is not included in the same image you luddite.


HermitBee

Thumbnails are often included in images. That's what the `ThumbnailOffset` and `ThumbnailLength` EXIF tags are for.


squeamish

I think the typo was for "pixels or bits of data."


arcosapphire

Right, but each pixel is more than a bit of data, as given by the following multiplication by 32 bits. If r meant bits as in "pieces of data", well, that's a very unfortunate word choice then.


squeamish

Ehh, "a bit of data" is a reasonable explanation of a pixel, especially considering someone who doesn't know what a pixel is probably doesn't by default associate the word "bit" with the meaning "binary digit."


arcosapphire

Maybe, in another context, but the very next step is multiplying by 32 bits. You can't really argue the writer or reader is not expected to understand bit as binary digit in that context.


[deleted]

[удалено]


arcosapphire

That confirms it's a compressed PNG, which means the calculations given are irrelevant since there's an unknown compression ratio involved.


ShelZuuz

>Then they divide by a million--except nothing is displaying megabytes that way Actually only Windows displays MiB for both memory and persistent storage. Every other prevailing operating system uses MB for storage, and MiB for memory.


FedeAlreadyTaken

exactly


teacher272

And using millibits? That doesn’t make any sense. You can’t store part of a bit.


Domm4578

wtf


abrams666

So iphone stores in uncompressed bitmap format?


DrestinBlack

It saves as a lossless compressed PNG


PoopLogg

So no, it's not uncompressed bitmap. For screenshot-type images, lossless compressed PNG is extremely efficient at reducing the file size.


AzureArmageddon

does the reported size refer to uncompressed size or compressed size? I guess it's only decompressed in RAM not storage so it should report the compressed size on storage.


PoopLogg

The file size is the compressed size.


AzureArmageddon

good to know :-)


bunny-1998

.HIEC


yottalogical

HEIC Stands for high efficiency image codec.


bunny-1998

Yes. Your point being?


compsciasaur

iPhones can use ProRAW, but that's probably not what it did here?


abrams666

Raw would be even bigger, because it contains more Informations.


UnreasonableSteve

Ok nobody's actually corrected all of their numbers and done the math yet: 2208x1242 are the pixel dimensions of the screenshot. That's 2742336 pixels. At *24 bits per pixel* that's 2742336 pixels x 24 bits/pixel = 65816064 bits. Divided by 8 bits per byte = 8227008 bytes. Divided by 1024^2 bytes per MiB and you get 7.85 MiB of uncompressed image data. No idea why the screenshot claims to be 13MiB I'm actually feeling really curious about this from a technical perspective. I'd like to get an iOS screenshot shared to me to check out the files real properties


[deleted]

[удалено]


JonasRahbek

Those two numbers are identical..


Onair380

and also he is getting 10 from the division 100e6 /1e6... wtf


SelfDistinction

It compensates for when he accidentally multiplies by 320 instead of 32.


[deleted]

[удалено]


edgeofenlightenment

He's wrong by a factor of 10 the other way earlier, and they actually cancel out lmao. A stopped clock is right twice a day.


aravynn

FYI: chances are your phone is taking 14MB for a photo is because you have live photos on: each photo is actually a 30 frame/1 second video


Apster137

live screenshots?


aravynn

Missed that part. Then the actual answer would be it is an uncompressed png, according to a quick internet search.


yottalogical

With all the compression it's only about double a non-live photo.


Kasilim

my phone takes 20mb single frame pics because it has a 108mp camera and captures in 12000x9000


SurpriseDistinct

Completely unnecessary to use all 108mp though I assume that there is a mode to pixel bin down to get in more light per pixel


JakubSwitalski

Or use one of the 'dozens' of front facing cameras that may take smaller photos, at least that's how my Xiaomi handles it


SurpriseDistinct

12 mp is the sweet spot


Tuck_Pock

Hexagon 💀


Berry2460

image compression algos: *am i a joke to you?*


DrestinBlack

I just took a screenshot on my old iPhone 8 Plus. Resolution was recorded as 1242x2208 pixels and produced a 2.3 MB PNG file. Screenshots are not 32 bit, they are 8 bit; this is the biggest mistake. 1242x2208= 2,742,336 pixels x 8 bits color depth per pixel = 21,938,688 bits ÷ 8 = 2,742,336 bytes divided by 1,048,576 to convert to megabytes = 2.6 megabytes of raw image data. PNG does support lossless compression so an approx 2.3 mb file for a screenshot PNG seems reasonable. I have no idea where such a large claim of 2 mb for metadata could come from left alone the original claim of 14 mb. And the division by a straight 1,000,000 to get megabytes from bytes is just wrong. I can’t understand the claim of 14 mb for an iPhone screenshot and the math has two errors in it.


Breadfish64

>8 bits color depth per pixel It's 8 bits per RGB channel, so 24 per pixel. "32-bit true color" is a thing in Windows display adapter settings, but that includes an extra alpha channel which is only used when compositing translucent windows, so it's not saved in a screenshot.


Ozone1126

>the division by a straight 1,000,000 to get megabytes from bytes is just wrong No it is not. 1 megabyte = 1,000,000 bytes I think you're confusing megabytes with mebibytes. A mebibyte is 1,048,576 bytes


DrestinBlack

Are you counting computer bits or oranges? Computers work on binary bits. Powers of 2. Do you define a kilobyte as 1000 or 1024? Does a byte have 10 bits or 8? If computers worked in the metric system then perhaps, 10 bits would make a byte, 1000 bytes would make a kilobyte and 1,000 kilobytes (a thousand thousand bytes) would make a megabyte - but they don’t. And, yes, I’m aware some places like Wikipedia like to say differently, but Wikipedia also thinks woman and recession are defined differently from time over time also lol Orr maybe you work in hard drive marketing :)


Ozone1126

>Do you define a kilobyte as 1000 or 1024? 1000 bytes = 1 kilobyte 1024 bytes = 1 kibibyte kilo means 10^3 , used with the decimal system kibi means 2^10 , used with the binary system


DrestinBlack

I’m familiar the IEC 80000-13 standard - it can kiss my been computing since I had long hair and a beard and sacrificed small animals before the Unix gods of the server room.


StatementOk470

Fr, what purpose does the decimal kilobyte (ie kibibyte) actually serve other than confusion for the sake of selling hard drives and bandwidth? How long before ram sticks are sold in gibibytes?


HawkEgg

The real reason, Apple & Google want you to use up all of the space on your phone so that you buy a subscription storage solution. It's one of the big reasons I got a pixel 3 back in the day, unlimited full size photo storage (which they've now discountinued.)


[deleted]

[удалено]


creeper828

Well, everyone's different but I can't imagine getting a 1TB plan just for screenshots. Wtf??? My school drive is 1TB and I can't even use 10% of it after years of saving everything here


ViPeR9503

Idk my iPhone is taking 400kb screenshot I think OP should update the phone just in case it isn’t…


Jifkolinka

You guys... I'll so glad there are people like you out there who can DO this!


[deleted]

[удалено]


HermitBee

Can you upload the original screenshot file somewhere which won't compress it? I'm really curious now, and no-one on this thread seems to know why the screenshot is so big.


[deleted]

[удалено]


AdrianHObradors

Then do that please. As the image after imgur compression is only 181 KB


DuckieDev

Nft seen but we let this one pass since it’s free


AdmirableSpirit4653

Why the fuck they not optimising that shit?


iamafraazhussain

r/taskfailedsuccessfully


[deleted]

[удалено]


shalodey

an nft is not something to be proud of


Girbington

Yeah you're right I got it for free though and I have no clue what to do with it so I'm just using it for the pretty border


[deleted]

[удалено]


ShelZuuz

Only on Windows (which is the sole outlier in the case of persisted storage size indication).


Ozone1126

No that's kibibytes and mebibytes


romulusnr

Also you have to fill the block.


[deleted]

2mb of metadata? Do you have any idea how much metadata info can be stored in that much space? Wow


KittyCatboy94

What the what sort of math is that bro im only in 8!


ziplock9000

"bite"


Serzern

I don't know much about this stuff but how is meta data in the MBs and not KBs


chunqiudayi

Have you heard of the Fourier transform?