Sublime Forum

Plain .ppm is not really supported

#1

PPM means (p)ortable (p)ix(m)ap

Format specification: https://netpbm.sourceforge.net/doc/ppm.html

It’s text format with structure like <label> <width> <height> <max_value> (<red> <green> <blue>)

I am using “Plain PPM” for my experiments. It means <label> is P3 and color component values are encoded as decimals in ASCII.

This snippet conforms to specification. It’s opened without problems by Xviewer:

P3 1 1 255 0 255 255

image

Sublime 4180 correctly believes it is image but fails to display it. I have to “Reopen File as Text” every time.

I believe it’s not hard to parse integers from string in Python. If not, just display it as text.

(Despite this minor issue your project is great! Using it for over 10 years.)

Best regards, Martin

0 Likes

#2

That looks like it’s displaying the image correctly. You can change which files get opened as images by default using the "image_file_patterns" setting.

0 Likes

#3

Image is a screenshot from Xviewer.

0 Likes

#4

Right. Sublime Text uses stb_image, and so only supports binary ppm files for image preview.

0 Likes