Questions tagged [ppm]

PPM is a pixmap image format used by the Netpbm library and other graphics software.

Portable Pixel Map (PPM) is a simple format for 24-bit color images.

The format allows data to be stored in either ASCII or binary format. PPM is the native format of the Netpbm graphics library and the format is described on the Netpbm web site. It is part of a family of formats including , , and , collectively tagged (the original name for what is now the Netpbm library).

280 questions
11
votes
2 answers

read PPM file and store it in an array; coded with C

I need to read a PPM file and store it in an array written in C. Can anybody help me out doing this? Thanks a lot.
mary
  • 111
  • 1
  • 1
  • 3
7
votes
2 answers

PPM to JPEG/JPG conversion for Python 3.4.1

Does anyone know of any way to convert a ppm file to a jpeg/jpg using python 3.4.1 specifically? I've looked around and can only find solutions for previous version of python.
star
  • 179
  • 1
  • 1
  • 6
7
votes
1 answer

Steganography in C

Trying to do basic Steganography on a PPM Image. I have the basic algorithm completed. Read in the file, check the header starts with P6, get the image width and height, and the pixel data. I need to have a total of four methods: ReadPPM, WritePPM,…
user1978536
  • 95
  • 1
  • 3
  • 5
5
votes
1 answer

C: Writing structs of RGB values to file to create ppm image - premature end of file

The program i am creating a steganography program that hides a secret message inside a .ppm image by changing random red pixel values to ascii characters. The program is based on code that is on stackoverflow for reading and writing ppm images (read…
Sean Turnbull
  • 53
  • 1
  • 4
5
votes
2 answers

C - Problems stepping through a struct pointer

This is fairly elementary and I'm probably missing something really obvious, but this one has me a bit stumped. Basically, let's say I'm trying to turn an entire PPM image red (that's not actually what I'm doing, but for the sake of troubleshooting,…
Austin
  • 73
  • 1
  • 5
5
votes
1 answer

Reading PPM Image in C#

What is the best way to read a PPM (P6) image file in C# and save it as a Bitmap?
codelove
  • 1,396
  • 3
  • 17
  • 35
4
votes
1 answer

Read/Write to PPM Image File C++

Trying to read and write to/from a PPM Image file (.ppm) in the only way I know how: std::istream& operator >>(std::istream &inputStream, PPMObject &other) { inputStream.seekg(0, ios::end); int size = inputStream.tellg(); …
user4640007
  • 97
  • 1
  • 2
  • 7
3
votes
1 answer

Converting a sequence of ppm images to video with python

I'm trying to make a video out of ppm images using IPython (python 2.7). I wrote this code : import cv2 import glob img1 = cv2.imread('C:/Users/Joseph/image0.ppm') height, width, layers = img1.shape video1 = cv2.VideoWriter('video1.avi', -1, 1,…
JoA
  • 53
  • 6
3
votes
2 answers

Meaning of int n != unsigned int(n)

I was reading a code segment that was checking if some values from a ppm file are correct. The values were read like this: image >> img_format >> width >> height >> maxval; And then to check if width and height are correct this was used: if (width…
3
votes
1 answer

Add noise to RGB image in python

I need to add noise to multiple of coloured images (file format is ppm; source: http://benchmark.ini.rub.de/Dataset/GTSRB_Final_Training_Images.zip) in python. The noised output images should be still in colour. I tryed the following: from scipy…
Peter
  • 157
  • 4
  • 11
3
votes
2 answers

Float PPM image file format?

I've found a PPM image with the header starting with PF (instead of standard P6, P5, P4, ... signatures). The resolution number is stored in floating point (-1.000). No comments are inserted to get how it was produced. Because the resolution, I…
Luca
  • 11,646
  • 11
  • 70
  • 125
3
votes
2 answers

Python bug that only appears on embossed image using Numpy

The intention of this program is to take a ppm image and emboss it. (The entire project details can be found here) I am helping with the grading of the assignment and cannot seem to find the student's bug. The original image I am using looks like…
jth41
  • 3,808
  • 9
  • 59
  • 109
3
votes
1 answer

4 triangles in rectangle displayed in PPM

I am trying to generate 4 triangles based on user inputted parameters for a rectangle. My idea is to get the slope from the center of the rectangle to the origin, which on a ppm file is in the top left. This causes everything to be reversed…
user1590454
3
votes
1 answer

PPM file data cannot be recognized

I'm writing a simple picture editor. It uses PPM files. From what I can tell, I feel like my code should work. However, I get this error Traceback (most recent call last): File "/home/zach/Downloads/piceditor (1).py", line 84, in
zburns12
  • 1,783
  • 3
  • 15
  • 16
2
votes
2 answers

How to convert images from the jpg format to ppm(P3)

I have recently learned how to read ppm3(P3) images in C++. I just read RGB pixels written in a plain format. I want to convert some certain jpg pictures to ppm3 and then experiment with different things, like identifying numbers there, the circled…
1
2 3
18 19