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
0
votes
1 answer

How would I use an array to print an image?

I am trying to figure out how I would print a box of concentric squares using an array, which looks like this: https://i.stack.imgur.com/fMJwb.jpg I have a table of the RGB values for each color, but I am not sure how to go about this. This is what…
user3583829
  • 15
  • 3
  • 7
0
votes
1 answer

Issues writing PNM P6

I'm writing a program that takes in two duplicate PNM P6 files, puts the memory of the first file into a buffer, creates a yellow diagonal line over that, and writes the result to the second file. When I run it, the output file is corrupted and…
0
votes
1 answer

Using Python 3.x to properly read ppm files

I am trying to read in data from a file, say: P3 400 200 255 255 255 255 0 255 0 0 0 0 And I need to account for the first 4 numbers not being pixel data but important information for the creation of the image. I have…
somebody
  • 85
  • 3
  • 10
0
votes
2 answers

Reading input from a file in python 3.x

Say you are reading input from a file structured like so P3 400 200 255 255 255 255 255 0 0 255 0 0 etc... But you want to account for any mistakes that may come from the input file as in P3 400 200 255 255 255 255 255 0 0 255 0 0 etc... I want to…
somebody
  • 85
  • 3
  • 10
0
votes
1 answer

how to properly read a PPM file using Python

Here is my overall instructions Write a Color class that represents an RGB color using integer values in the range 0 to 255. Your class must: Be placed in image.py Provide a constructor that accepts the values of the red, green, and…
User9193
  • 57
  • 1
  • 11
0
votes
3 answers

Java ImageIO read image in ppm format return null

Does javax.imageio.ImageIO read image in PPM format (e.g., rawbits P6) at all? BufferedImage rawimage = ImageIO.read(new File(getClass().getResource("/lena.ppm").getFile())); There is no Exception but rawimage is null. Other formats like png and…
user815613
  • 95
  • 3
  • 8
0
votes
1 answer

yuv to rgb conversion columns not aligned

I am converting a YUV422 frame to a PPM file - (RGB888). The image is converting mostly. Colors are fine. But each seems row is askew, as if extra Here is the frame conversion function: BYTE* CYUV::toRGB() { BYTE* rgb = new…
user3182551
  • 343
  • 2
  • 9
0
votes
1 answer

Reading bytes of PPM into a flexible member array in a struct

I would like to read through the bytes of a ppm image and store it in my flexible member array, which is contained in a structure. I hope I didn't mess up the allocation or something. This is how it looks now: typedef struct ppm { unsigned…
imre
  • 379
  • 2
  • 6
  • 17
0
votes
1 answer

rotate an image PPM

I'm trying to rotate to the left/or to the right an image ppm. I succeeded to rotate 180 degree but the 90 seems not working.. This is my code // working 1-D array of pixels pixel *n_array = new Image(width, height); // set up the new array…
Pépito
  • 57
  • 4
  • 11
0
votes
0 answers

Editing an image in ppm format

I'm trying to edit an image by multiplying the red component of each pixel by 10 and leaving the other components (green and blue) untouched. I'm not really sure how I'm supposed to edit the pixels one by one. I have this so far. I think there is…
winsticknova
  • 365
  • 2
  • 5
  • 17
0
votes
1 answer

Error using map with custom objects? Probably a Syntax issue

Ok I am writing a code to modify .ppm image files. A pic gets read in and stored in a PPM class object. Each Pixel is stored in a RGB struct. Eventually it will convert all the colors in the original image to ones from a small color pallet. It does…
Robert Ryder
  • 39
  • 1
  • 8
0
votes
1 answer

Strange (multiplied) PPM image after Sobel filtration

I am having quite strange problem with my application which is meant to apply Sobel filter to the image. The problem is that each time I have my image multiplied and moved a little. The multiplication number depends on the picture size. This is an…
sebap123
  • 2,541
  • 6
  • 45
  • 81
0
votes
1 answer

Ansi C read from PPM file freez

I am struggling with some issue in my ansi c code. I want to read PPM picture (P6) and then write it to the color (int) arrays. Everything should work great, but unfortunatelly it isn't. The problem is, that the reading freezes at some point - at…
sebap123
  • 2,541
  • 6
  • 45
  • 81
0
votes
1 answer

OpenGl texturing ........ ppm background

i am using a ppm loader to set image as a background , but there is a problem in colors here is the code and the image that i am use . https://i.stack.imgur.com/rkm1T.jpg https://i.stack.imgur.com/RXw7h.jpg here is the code ..... texture.h …
0
votes
1 answer

PPM Colors Issues

any one please know what is the wrong with this code colors did not match ? iam using ppm loader to load an image but colors did not match the image when it loaded in the game . when i pass a white image it is appear black , when i pass black it…