s3d image processing with netpbm-tools
Posted: Sun Jun 13, 2010 10:01 pm
howdy all,
I wonder if I'm the only one who knows/cares about this set of command line programs but anyway, I'd like to tell you about it if you care. It's Netpbm-tools and its home is on sourceforge: http://netpbm.sourceforge.net/" onclick="window.open(this.href);return false; and you can get the Windows version from here:
http://gnuwin32.sourceforge.net/packages/netpbm.htm" onclick="window.open(this.href);return false;
It's not specifically for s3d but I've found it to be a handy set of commands that are scriptable so that you can process many files in a batch and lately I've been using them for various things so I thought I'd share my info with anyone who cares or needs it. I will be mostly giving examples for Windows users but Linux users should have an easy time adapting the concepts to Linux bash scripts.
Examples:
A .jps to anaglyph converter:
One thing I've done lately is to write a script that converts .jps files to anaglyph and you can use it to convert a whole directory at a time. I'm sure other programs can do that too but if anyone needs it, they can use this one and tweak the colors or techniques using any ideas of their own that they might have. It's pretty easy to hand-tune your routines and that may be a capability that other converters lack.
an interlaced/checkerboard mask generator:
If you're dealing with interlaced or checkerboard 3d, you might need a mask that consists of only black and white pixels in a pattern of alternating stripes or else in a checkerboard pattern. You can get such a mask easily by using some of these commands in the right way and then you can use them to compose or decompose interlaced s3d images.
a blue-line-code adder:
Another thing I've done is to make a script that adds BLC code to my 3d screenshots and then I can use them with sView (stereoscopic viewer) and when I'm using it in fullscreen in shutterglass mode, my glasses automatically start shuttering and they're always in sync with whatever screenshot I'm looking at. The only drawback is that if I zoom in or out, then I lose the blue-line detection. Still, it's pretty nice to have it work as it does.
other apps?
If you're very clever, you may be able to use these tools to come up with some different ideas about how to convert anaglyph to non-anaglyph 3d but I think that's pretty hard to do a good job with but you can get "good enough" results I think, possibly depending on the video.
Anyway, if you're interested in these tools, you can choose to install the "complete package" from the above link and then add ";C:\Program Files\GnuWin32\bin" to your PATH if you installed to the default location. Then in your Start menu, "NetPbm" will probably be under "GnuWin32".
Here's the user manual:
http://netpbm.sourceforge.net/doc/" onclick="window.open(this.href);return false;
and here's a good index of commands available:
http://netpbm.sourceforge.net/doc/directory.html" onclick="window.open(this.href);return false;
And here's some basic info on the filetypes:
.pbm - portable bitmap: 1 bit per pixel, black and white pixels only
.pgm - portable graymap: generally 8 bits per pixel meaning you have 256 shades of gray.
.ppm - portable pixmap: generally 24 bits per pixel full RGB color.
.pnm - portable anymap: any of the above
.pam - portable anymap or arbitrarymap: any of the above but can have an alpha channel.
These filetypes are lossless but there can be some color conversion involved so I suppose there is some imperceptible data loss. Judge for yourself. Filesizes are larger than jpeg since it's lossless. There's binary and ascii versions of each pbm, pgm and ppm but you'll almost always be using binary. Sometimes you'll wonder if you really need to convert between formats in order to use a command so just try your idea with your current format and see if it works. For example, the pamcomp command says it uses a graymap as an alpha mask but you can go ahead and use a pixmap and it works fine. You don't need to convert your ppm to pgm in order to use it as an alpha mask in that case.
and here's the Wikipedia page:
http://en.wikipedia.org/wiki/Portable_anymap" onclick="window.open(this.href);return false;
Onward...
I wonder if I'm the only one who knows/cares about this set of command line programs but anyway, I'd like to tell you about it if you care. It's Netpbm-tools and its home is on sourceforge: http://netpbm.sourceforge.net/" onclick="window.open(this.href);return false; and you can get the Windows version from here:
http://gnuwin32.sourceforge.net/packages/netpbm.htm" onclick="window.open(this.href);return false;
It's not specifically for s3d but I've found it to be a handy set of commands that are scriptable so that you can process many files in a batch and lately I've been using them for various things so I thought I'd share my info with anyone who cares or needs it. I will be mostly giving examples for Windows users but Linux users should have an easy time adapting the concepts to Linux bash scripts.
Examples:
A .jps to anaglyph converter:
One thing I've done lately is to write a script that converts .jps files to anaglyph and you can use it to convert a whole directory at a time. I'm sure other programs can do that too but if anyone needs it, they can use this one and tweak the colors or techniques using any ideas of their own that they might have. It's pretty easy to hand-tune your routines and that may be a capability that other converters lack.
an interlaced/checkerboard mask generator:
If you're dealing with interlaced or checkerboard 3d, you might need a mask that consists of only black and white pixels in a pattern of alternating stripes or else in a checkerboard pattern. You can get such a mask easily by using some of these commands in the right way and then you can use them to compose or decompose interlaced s3d images.
a blue-line-code adder:
Another thing I've done is to make a script that adds BLC code to my 3d screenshots and then I can use them with sView (stereoscopic viewer) and when I'm using it in fullscreen in shutterglass mode, my glasses automatically start shuttering and they're always in sync with whatever screenshot I'm looking at. The only drawback is that if I zoom in or out, then I lose the blue-line detection. Still, it's pretty nice to have it work as it does.
other apps?
If you're very clever, you may be able to use these tools to come up with some different ideas about how to convert anaglyph to non-anaglyph 3d but I think that's pretty hard to do a good job with but you can get "good enough" results I think, possibly depending on the video.
Anyway, if you're interested in these tools, you can choose to install the "complete package" from the above link and then add ";C:\Program Files\GnuWin32\bin" to your PATH if you installed to the default location. Then in your Start menu, "NetPbm" will probably be under "GnuWin32".
Here's the user manual:
http://netpbm.sourceforge.net/doc/" onclick="window.open(this.href);return false;
and here's a good index of commands available:
http://netpbm.sourceforge.net/doc/directory.html" onclick="window.open(this.href);return false;
And here's some basic info on the filetypes:
.pbm - portable bitmap: 1 bit per pixel, black and white pixels only
.pgm - portable graymap: generally 8 bits per pixel meaning you have 256 shades of gray.
.ppm - portable pixmap: generally 24 bits per pixel full RGB color.
.pnm - portable anymap: any of the above
.pam - portable anymap or arbitrarymap: any of the above but can have an alpha channel.
These filetypes are lossless but there can be some color conversion involved so I suppose there is some imperceptible data loss. Judge for yourself. Filesizes are larger than jpeg since it's lossless. There's binary and ascii versions of each pbm, pgm and ppm but you'll almost always be using binary. Sometimes you'll wonder if you really need to convert between formats in order to use a command so just try your idea with your current format and see if it works. For example, the pamcomp command says it uses a graymap as an alpha mask but you can go ahead and use a pixmap and it works fine. You don't need to convert your ppm to pgm in order to use it as an alpha mask in that case.
and here's the Wikipedia page:
http://en.wikipedia.org/wiki/Portable_anymap" onclick="window.open(this.href);return false;
Onward...