{"success":true,"data":{"ext":"pbm","name":"PBM","description":"Portable Bitmap (PBM) is a simple monochrome image format originally defined by Jef Poskanzer and now maintained as part of the Netpbm family. It is used for storing black-and-white graphics, line art, icons, and intermediary image data in scripting, printing, and conversion workflows. PBM is a legacy format with minimal features, and files are generally safe, though untrusted images should still be handled by standard parsers.","mime":["image/x-portable-bitmap"],"risk_level":"Safe","signatures":[{"hex":"50 31","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"50 31 0A","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"50 34 0A","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]}],"related":["avif","bmp","cr2","cr3","dib","exr"],"usage":{"python":"def is_pbm(file_path: str) -> bool:\n    \"\"\"Check if file is a valid PBM by magic bytes.\"\"\"\n    signature = bytes([0x50, 0x31])\n    with open(file_path, \"rb\") as f:\n        return f.read(2) == signature","node":"function isPBM(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x50, 0x31]);\n  return buffer.subarray(0, 2).equals(signature);\n}","go":"func IsPBM(data []byte) bool {\n    signature := []byte{0x50, 0x31}\n    if len(data) < 2 {\n        return false\n    }\n    return bytes.Equal(data[:2], signature)\n}"},"category":"Images"}}