{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"image-file-size"},"result":{"entity_type":"calculator","id":"image-file-size","calculator_id":"image-file-size","canonical_url":"https://tttkmbb.com/photography/image-file-size","name":"Image File Size Calculator","title":"Image File Size Calculator – Uncompressed and Compressed Size from Pixels, Bit Depth and Channels","category":"photography","category_name":"Photography & Optics","tool_name":"estimate_image_file_size","featured_mcp_tool":false,"description":"Estimates the storage size of an image from its pixel dimensions, bits per channel, number of channels and a compression ratio, and scales the result to a number of images, in decimal megabytes and gigabytes.","use_when":"You need to estimate how much space photos, scans or RAW files take, or how many images fit on a memory card or drive.","do_not_use_when":"You need a video's file size from bitrate (use video-file-size) or a print size from megapixels (use megapixels-print-size).","inputs":[{"name":"width_px","label":"Image width","type":"integer","unit":"px","required":true,"min":1,"max":1000000,"description":"Image width in pixels.","example":6000},{"name":"height_px","label":"Image height","type":"integer","unit":"px","required":true,"min":1,"max":1000000,"description":"Image height in pixels.","example":4000},{"name":"bit_depth_per_channel","label":"Bits per channel","type":"integer","unit":"bit","required":false,"default":8,"min":1,"max":32,"description":"Bits per colour channel: 8 for JPEG/PNG, 12–14 for camera RAW, 16 for TIFF/PNG-16.","example":8},{"name":"channels","label":"Channels","type":"integer","required":false,"default":3,"min":1,"max":4,"description":"Colour channels: 1 for greyscale or Bayer RAW, 3 for RGB, 4 for RGBA/CMYK.","example":3},{"name":"compression_ratio","label":"Compression ratio","type":"number","required":false,"default":1,"min":1,"max":1000,"description":"Uncompressed size ÷ file size: 1 for uncompressed TIFF/BMP, about 2 for lossless RAW/PNG, 5–8 for JPEG at highest quality, 10 for JPEG quality ~90, 20+ for web JPEGs.","example":10},{"name":"image_count","label":"Number of images","type":"integer","required":false,"default":1,"min":1,"max":10000000,"description":"How many images of this size to total.","example":100}],"outputs":[{"name":"pixels","label":"Pixels","type":"integer","unit":"px","decimals":0,"description":"width_px × height_px."},{"name":"bits_per_pixel","label":"Bits per pixel","type":"integer","unit":"bit","decimals":0,"description":"bit_depth_per_channel × channels."},{"name":"uncompressed_bytes","label":"Uncompressed size","type":"integer","unit":"B","decimals":0,"description":"pixels × bits per pixel / 8."},{"name":"uncompressed_mb","label":"Uncompressed size (MB)","type":"number","unit":"MB","decimals":2,"description":"Uncompressed bytes / 10⁶ (decimal megabytes, as used on storage labels)."},{"name":"compressed_mb","label":"File size per image (MB)","type":"number","unit":"MB","decimals":2,"description":"Uncompressed MB / compression_ratio."},{"name":"total_mb","label":"Total size (MB)","type":"number","unit":"MB","decimals":2,"description":"File size × image_count."},{"name":"total_gb","label":"Total size (GB)","type":"number","unit":"GB","decimals":3,"description":"Total MB / 1000."},{"name":"images_per_gb","label":"Images per GB","type":"number","decimals":0,"description":"How many files of this size fit in one decimal gigabyte."}],"input_schema":{"type":"object","properties":{"width_px":{"description":"Image width in pixels. Unit: px.","type":"integer","minimum":1,"maximum":1000000,"examples":[6000],"x-unit":"px"},"height_px":{"description":"Image height in pixels. Unit: px.","type":"integer","minimum":1,"maximum":1000000,"examples":[4000],"x-unit":"px"},"bit_depth_per_channel":{"description":"Bits per colour channel: 8 for JPEG/PNG, 12–14 for camera RAW, 16 for TIFF/PNG-16. Unit: bit.","type":"integer","minimum":1,"maximum":32,"default":8,"examples":[8],"x-unit":"bit"},"channels":{"description":"Colour channels: 1 for greyscale or Bayer RAW, 3 for RGB, 4 for RGBA/CMYK.","type":"integer","minimum":1,"maximum":4,"default":3,"examples":[3]},"compression_ratio":{"description":"Uncompressed size ÷ file size: 1 for uncompressed TIFF/BMP, about 2 for lossless RAW/PNG, 5–8 for JPEG at highest quality, 10 for JPEG quality ~90, 20+ for web JPEGs.","type":"number","minimum":1,"maximum":1000,"default":1,"examples":[10]},"image_count":{"description":"How many images of this size to total.","type":"integer","minimum":1,"maximum":10000000,"default":1,"examples":[100]}},"additionalProperties":false,"required":["width_px","height_px"]},"output_schema":{"type":"object","properties":{"pixels":{"description":"width_px × height_px. Unit: px.","type":"integer","x-unit":"px"},"bits_per_pixel":{"description":"bit_depth_per_channel × channels. Unit: bit.","type":"integer","x-unit":"bit"},"uncompressed_bytes":{"description":"pixels × bits per pixel / 8. Unit: B.","type":"integer","x-unit":"B"},"uncompressed_mb":{"description":"Uncompressed bytes / 10⁶ (decimal megabytes, as used on storage labels). Unit: MB.","type":"number","x-unit":"MB"},"compressed_mb":{"description":"Uncompressed MB / compression_ratio. Unit: MB.","type":"number","x-unit":"MB"},"total_mb":{"description":"File size × image_count. Unit: MB.","type":"number","x-unit":"MB"},"total_gb":{"description":"Total MB / 1000. Unit: GB.","type":"number","x-unit":"GB"},"images_per_gb":{"description":"How many files of this size fit in one decimal gigabyte.","type":"number"}}},"formula":"uncompressed_bytes = width_px × height_px × bit_depth_per_channel × channels / 8; compressed_mb = uncompressed_bytes / 10⁶ / compression_ratio; total_gb = compressed_mb × image_count / 1000","method":"Pixel data only: real files add headers, metadata and embedded previews (RAW files carry a JPEG preview of several MB), and lossy compression ratios vary with image content by a factor of 2 or more. 1 MB = 1 000 000 bytes; binary MiB values are 4.9 % smaller.","sources":[{"name":"Wikipedia – Color depth","url":"https://en.wikipedia.org/wiki/Color_depth","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – Raw image format","url":"https://en.wikipedia.org/wiki/Raw_image_format","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – JPEG","url":"https://en.wikipedia.org/wiki/JPEG","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"24 MP 8-bit RGB, JPEG at ratio 10, 100 images","inputs":{"width_px":6000,"height_px":4000,"bit_depth_per_channel":8,"channels":3,"compression_ratio":10,"image_count":100},"expected":{"pixels":24000000,"uncompressed_bytes":72000000,"uncompressed_mb":72,"compressed_mb":7.2,"total_gb":0.72,"images_per_gb":139},"url":"https://tttkmbb.com/api/v1/calculate/image-file-size?width_px=6000&height_px=4000&bit_depth_per_channel=8&channels=3&compression_ratio=10&image_count=100"},{"name":"24 MP 14-bit uncompressed RAW (one Bayer channel)","inputs":{"width_px":6000,"height_px":4000,"bit_depth_per_channel":14,"channels":1},"expected":{"bits_per_pixel":14,"uncompressed_bytes":42000000,"uncompressed_mb":42,"total_mb":42},"url":"https://tttkmbb.com/api/v1/calculate/image-file-size?width_px=6000&height_px=4000&bit_depth_per_channel=14&channels=1"}],"faq":[{"q":"Why is a RAW file counted with one channel?","a":"A Bayer sensor records one colour sample per pixel (12 or 14 bits); the three RGB channels are only created when the RAW is demosaiced. Lossless RAW compression then roughly halves the file."},{"q":"What compression ratio should I use for JPEG?","a":"Camera JPEGs at highest quality are typically 5–8× smaller than uncompressed 8-bit RGB (a 24 MP JPEG is 9–14 MB); quality 90 gives about 10×, and web-optimised images 20× or more."}],"tags":["image file size","photo storage","megabytes per photo","raw file size","bit depth","memory card capacity"],"related":[{"calculator_id":"data-storage","reason":"Convert between MB, MiB, GB and other storage units."},{"calculator_id":"video-file-size","reason":"File size of video from bitrate and duration."},{"calculator_id":"megapixels-print-size","reason":"Print size the same pixel dimensions allow."}],"links":{"html":"https://tttkmbb.com/photography/image-file-size","markdown":"https://tttkmbb.com/photography/image-file-size.md","json":"https://tttkmbb.com/photography/image-file-size.json","api":"https://tttkmbb.com/api/v1/calculate/image-file-size","schema":"https://tttkmbb.com/api/v1/calculators/image-file-size","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T03:46:20Z"}