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
1
vote
1 answer

PPM conversion char to int grants negative numbers

My task was to convert chars from PPM picture to int array, and later do other transformations on that array. I got formula, which supposed to convert 3 chars from PPM file (Red, Green and Blue in that order in file) to one int variable int main(){ …
Saper9
  • 83
  • 8
1
vote
2 answers

How to convert image.jpg to image.ppm in c++

I now hope to convert image.jpg to image.ppm via c++ code implementation. What library can I implement in C++? By the way: my work platform is Raspberry Pi 3B+. I look forward to any help and reply from you.
1
vote
1 answer

Converting uint8_t to binary

In class, we are learning how to create ppm6 files. We have a 2D array of uint8_t, and the class is asking us to use fwrite() to somehow convert this 2D array into bunch of binary characters that look like…
bambdwr
  • 55
  • 1
  • 5
1
vote
0 answers

Can't read channels of FS-IA6B

I have a FS-IA6B, Flysky FS-I6 and Raspberry Pi Zero. I want to read all channels from FS-IA6B. I use C language. I connected the power to the FS-IA6B and 4 channels to the pins on Raspberry Pi to 25, 24, 23 and 21. I randomly get zeros and ones,…
goose
  • 109
  • 1
  • 10
1
vote
1 answer

How to pixelate a binary (P6) PPM file

I am struggling to pixelate an image which is made up of RGB values stored in a binary (P6) PPM file. The steps to pixelate the image are as follows: Read in the binary data and store it in a 1-dimensional array Iterate through the data stored in…
p.luck
  • 646
  • 2
  • 9
  • 34
1
vote
1 answer

Seperate 4 channels (R,G,G,B) of .raw image file and save them as valid image in c++

I have to take a .raw12 file, separate the 4 channels (R, G, G, B) and save them as valid images (8-bits in memory) without using any external library (.ppm) in C++. You can read about raw12 here and ppm file format here. I have written the code but…
Tukai
  • 13
  • 1
  • 8
1
vote
0 answers

modification of a PPM image with python

I'm trying to turn a red smiley(PPM) into a green smiley(PPM) by modifying the source code with python (I use PyCharm CE). When I print the source file, I have this : b'P6\n100 100\n255\n\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff... The goal is to…
Paul Lecomte
  • 141
  • 1
  • 10
1
vote
0 answers

c++ "Run-Time Check Failure #2 - Stack around the variable was corrupted" error while reading values from a ppm image file

I am trying to read values from a ppm image file and i get "Run-Time Check Failure #2 - Stack around the variable 'numbers' was corrupted" error. I am new to c++ and programming in general and i dont understand what is the problem, can someone…
JDoe
  • 27
  • 7
1
vote
1 answer

Save RGB image as PPM format

I am trying to create RGB image in C++. I am not using any image libraries like OpenCv. Firstly, I tried to create grayscale image. I want to draw rectangle to image. I am giving parameters at function like starting points, width, height etc. This…
Süleyman Bilgin
  • 172
  • 1
  • 11
1
vote
4 answers

Reading ppm files and using fscanf()

I'm trying to parse through a ppm file, but first need to verify if the header info is correct. A ppm file may have the following formats: P3 100 100 255 data... or p3 100 100 255 data... I'm using fscanf (file_stream, "P3 %d %d %d", &width,…
endmade
  • 159
  • 1
  • 4
  • 9
1
vote
0 answers

C++ convert ppm to jpeg

I would like to convert my ppm image to a jpeg with libjpeg. But how can I do that, or is it simpler to write a jpeg with my data instead of converting the ppm? Here is my code for writing the ppm file: void PPMOutput::createOutput( string…
potu1304
  • 75
  • 4
  • 19
1
vote
1 answer

Stuck implementing boundary checks on frame windows for mean filtering

I have a function that successfully reads rgb values from a ppm and a function that successfully writes to a ppm. What I am trying is a function called denoiseImage that changes rgb values from a ppm using mean filtering with a frame window size n…
TheShield
  • 297
  • 1
  • 5
  • 18
1
vote
1 answer

Is there any way to save two 2D numpy arrays as one plain ppm image?

I'm looking for a way to save (efficiently if possible) two 2D numpy arrays into one plain ppm image. I think the only difference between standard (raw) and plain ppm image is than the latter limits line length to 70 chars. The only way I can think…
ad1v7
  • 187
  • 1
  • 12
1
vote
4 answers

run a function (from a .py file) from a linux console

maybe the title is not very clear, let me elaborate. I have a python script that open a ppm file , apply a chosen filter(rotations...) and create a new picture. until here everything work fine. but I want to do the same thing through a linux console…
Alpagut
  • 1,173
  • 5
  • 15
  • 21
1
vote
2 answers

Reading PPM format images

P6 650 652 255 P6 indicates that it is a PPM image. The next two fields are the width and height of the image. The last field gives the maximum pixel value. At the end of the header is a \n and then the binary pixel data. The image is in color so…
asilvester635
  • 81
  • 2
  • 13