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

Won't Read in My Image

I am reading in a PPM file, and I have used printf's throughout the function to see if it will print but for some reason it prints the p3/comment/width/height/maxcolor but it wont print the pixels... I tried checking via using printf statements…
Dave Boz
  • 49
  • 8
0
votes
2 answers

Flipping Vertices with C

I am trying to flip an image in C vertically so if the image is < it will end up > and my function includes //Setting the struct up for the pixel's struct pixel { unsigned char red; unsigned char green; unsigned char blue; }; //Setting…
Dave Boz
  • 49
  • 8
0
votes
1 answer

Generating not sinusoidal sound output in Java

For a school project I have to control my RC plane from my computer using Java. The way I want to achieve this is by connecting my remote to my MacBookPro via a 3.5mm cable (remote's trainer port). The way I have to communicate with the remote, is…
Pim16aap2
  • 1
  • 2
0
votes
1 answer

Creating a flag in C through PPM

I am trying to design the Denmark flag in C through PPM but I can't seem to get my function to work as well as I want to find a more efficient way to loop all the places together, instead of doing all if/else if statements. for(i=0; i < height;…
Deej
  • 5
  • 3
0
votes
3 answers

What am I doing wrong when rotating the picture by 90 degrees

I'm absolutely stumped with this problem. So here's my logic with rotating an array by 90 degrees: Example: 1 2 3 4 5..... ^ 2 6 8 7 4..... | 6 4 9 8 0..... | .....THEN..... ------> 8 3 0 5 9..... | So If I want to rotate it by 90…
MDuh
  • 415
  • 1
  • 7
  • 19
0
votes
0 answers

How do I draw two half circles on this image?

Here's my image: I've already written code that will give me a ppm file with the horizontal white and red bars. But what I'm having trouble with is, how do I draw those two half circles? It is IDEAL to use nothing more complicated than for loops/if…
user2387766
0
votes
1 answer

Why is Gimp complaining with "Premature end of file"?

I'm trying to construct a ppm file that will give me the image of this flag: It is a 1200 (columns) by 600 (rows) image and the width of the vertical red bar is 300 columns. I already wrote the code and it compiled fine, but when I try to view the…
user2387766
0
votes
2 answers

Why is my image not matching what I expect it to look like?

So, I have to create a ppm file that will give me the image of the italian flag (3 vertical bars in the order from left to right, green, white, and then red). And the image has to be 600 by 400. (columns by rows) I've tried rewriting my code…
user2387766
0
votes
2 answers

Reading a binary number from a file and saving it as an integer

I am trying to write a converter from P6 to P3, which means from data saved in binary to data saved in ASCII. This is the function I wrote to do the job but red,green and blue integers get garbage values instead of their decimal value. int…
Quaker
  • 1,483
  • 3
  • 20
  • 36
0
votes
1 answer

convert data file into a image file using MATLAB

I need to convert a data file into ppm/png/any other format using Matlab ? I have a data file having one column and 250000 rows of integer numbers, ranging from 0 to say 5. Data (say) in file are as follows: 2 1 0 5 2 1 3 . . . 0 5 1 4 I want to…
ADK
  • 259
  • 2
  • 17
0
votes
1 answer

ppmtogiff: to many colors workaround

I'm working on a script that takes an .xwd image, runs wxdtopnm on it then pipes that to ppmtogif. Basically: exec wxdtopnm < file.xwd | ppmtogif > file.gif However, sometimes I get an error ppmtogiff: to many colors - try doing a 'ppmquant…
Daniel
  • 2,435
  • 5
  • 26
  • 40
0
votes
2 answers

Why am I getting "Segmentation Fault" when I run my program?

My program decodes an image that is covered by random pixels, to decode the image, I have to multiply each pixel's red color component by 10. The green and blue color components are the same values as the new red component. I've created multiple…
user2387766
0
votes
2 answers

What's wrong with my program to decode an image?

I'm given an image file and the real image is hidden behind random pixels. I have to decode the image by multiplying the red value by 10 and by setting the green/blue values equal to that new red value. (And I can't go past the max value for color…
user2387766
0
votes
2 answers

Rotate PPM image 90 degrees

I am trying to rotate a PPM image 90 degrees. I am currently able to rotate the image 180 degrees. I am not sure on how to do this. I know that the height and width are swapped, but I am not sure where to go from there. void write_ppm_image(const…
Dreamer78692
  • 215
  • 5
  • 20
0
votes
2 answers

Creating a 2D-Array to output a pmm file C++

The instructions that were given to me were very vague and I'm completely lost on what I'm supposed to do. Need some help. I'll try to explain and hopefully someone can help me. I need to generate a ppm file of specified a width and height when you…
BerkleyJ
  • 13
  • 3