Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do I specify the PPM format? #357

Unanswered
Nakilon asked this question in Q&A
Dec 24, 2022 · 1 comments · 2 replies
Discussion options

I see that by default the ppm format is P6. How do I change it?
.write_to_file "temp.ppm[format=P5]"

ppmsave: no property named `format' (Vips::Error)

.write_to_file "temp.ppm", format: "P5"

unable to call VipsForeignSavePpmFile: unknown option format (Vips::Error)
You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

Hi @Nakilon,

It's done from the file extension, so .pfm saves as float, for example. There's also pgm, pbm, .pgm. and .ppm.

8.14 has a new feature where saving as .pnm will automatically use the best format for your data.

https://github.com/libvips/libvips/blob/gh-pages-8.14/_posts/2022-12-22-What's-new-in-8.14.md#other

You must be logged in to vote
2 replies
Comment options

Oh, format should work too. I see:

$ vips copy k2.jpg x.ppm[format=pfm]
$ more x.ppm
PF
#vips2ppm - 2022年12月24日T11:31:30.717226Z
1450 2048
-1
...

Maybe you have an old version of libvips? format was added in 8.13.

Comment options

Oh, yes, it's vips-8.11.3-Wed Aug 11 09:29:27 UTC 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /