Questions tagged [ppm]

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

-1
votes
0answers
8 views

How to read a PPM (P3) file and display it as an image

I'm trying to write a program to read an ppm (P3) file, and then display an image based of what the file contains. It should ask the user for a file, read the file and then render the pixels to the ...
2
votes
1answer
119 views

How to pixelate an image

I am attempting to pixelate a P6 PPM format image via the following steps: Read a PPM image in grids of 4x4 Find the average RGB colour value of each 4x4 grid Write to a new file by setting each ...
1
vote
1answer
80 views

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

spatstat model predictions for a new dataset

I have a model as below, fit <- ppm(dat.ppp, trend = ~ tpo + sbd + water + nitro + roaden + hpop + temp + elev) I want to predict to a new dataset with same covariate names with different values ...
2
votes
2answers
103 views

Convert image to CSV

What is away to break up an image into a grid of square cells, color each cell with the average color it contains, and export the resulting averages as a csv file? Since ppms are simple image formats,...
2
votes
1answer
39 views

Problems printing out an array for a ppm file

I am trying to create an array using a struct in order to create a ppm file. I then want to call other functions in order to change the color values (rgb) for each cell to make shapes. This is as far ...
0
votes
0answers
42 views

Dumping Subtitles From AVPicture into ppm Format File

In FFMPEG sofftware, AVPicture is used to store image data using data pointer and linesizes. It means all subtitles are stored in the form of picture inside ffmpeg . Now I want to dump subtitles from ...
0
votes
0answers
49 views

How to convert from dlib array2d<rgb_pixel> into an unsigned char pointer?

EDIT: Solution found I need to save a PPM file with the resulting image of a transformation using dlib. I know the resulting image from dlib is fine, because I can save it as png and open it for a ...
0
votes
2answers
116 views

How to save png copies of ppm images in Python

I have a folder full of ppm images and I want to save png copies of them. How do I do that? I've tried executing the following code but nothing happens. import cv2 import numpy as np import glob ...
0
votes
0answers
51 views

Reading a PPM in C with fread() is returning only the first 5 values correctly

I am trying to create a program to read a .ppm file in C that reads the raw data and converts it to RGB values. My code works just fine up until the 5th pixel, then it just starts repeating the same ...
0
votes
1answer
50 views

How do I change my function so that the entire header can be parsed into the new file?

So I created a function is able to pull the header from a file and put it into a new file without the comments. All the .ppm files have a max color value of 255 so here is my function: void ...
0
votes
1answer
24 views

Printing a PPM file - Wrong spaces

I need to print the a ppm picture but the output isn't organized as it should be, my code: public static int[][][] read(String filename) { StdIn.setInput(filename); StdIn.readLine(); ...
3
votes
2answers
283 views

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; ...
1
vote
0answers
61 views

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\...
1
vote
0answers
72 views

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 ...
2
votes
1answer
143 views

Mandelbrot image generator in C++ using multi-threading “overwrites(?)” half the image

I don't really know how to explain my problem properly, but hopefully you can understand it using the images i provide. I made this Mandelbrot image generator using a template and a tutorial on the ...
0
votes
0answers
42 views

Simple rasterizer producing incorrect ppm file

Ive been using a guide provided by ScratchAPixel to implement a simple rasterizer that produces a PPM file. When I execute the code (copy and pasted) my output image is different to theirs. It almost ...
0
votes
1answer
70 views

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 ...
0
votes
0answers
31 views

Create a 24bit RGB ppm image in java

The task is to create a 24bit RGB ppm image and store it in a byte array. Seems simple enough, I did it with jpg and got it right in the first try. ppm does not seem to be copying to the file though, ...
-1
votes
2answers
51 views

Read ppm header information and output to console and output file in C

Beginning to learn C; I'm trying to read and process characters as I come to them while discarding whitespace characters. I need to also determine if it's a comment '#' or the first character of the ...
0
votes
1answer
126 views

How to convert PPM images to JPG in Matlab?

I have some PPM images (stereo) that I read with imread() and I want to save the same images in JPEG with different Quality factors. Here is my code. %Read PPM image L = imread(filename_L); %Create ...
0
votes
1answer
13 views

How to escape square brackets in hp ppm workbench

How to escape square brackets in hp ppm workbench inorder to use Regexp_substr command. Because Regexp_substr is having [^,] in the syntax and this is being considered as token in Hp ppm workbench.
0
votes
0answers
31 views

Writting characters/text in a ppm file

I'm currently in the last stretch of my university's C class and I am stumped on a small part of my homework. The homework takes a text file with lines of functions and converts them to a pixels in a ...
1
vote
0answers
302 views

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

how to write circle to ppm file by c++

I want to draw a circle and X into a ppm file. I use the following method (described below) but I want to know if there is a faster or more efficient method than the method I use. My method is to ...
2
votes
1answer
1k views

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 ...
0
votes
0answers
82 views

How to encode message into image

I have a school project I've been working on for awhile now. It is supposed to encode a message into an image via red pixel values. It should work like this: set pixels red value equal to the first ...
0
votes
0answers
290 views

How to combine ppm image files in C using only system calls?

I've found some similar questions on the internet, but not with system calls. I'm doing an exercise in my system programming class. It asks you to combine ppm image files in binary form(P6, not P3) ...
-1
votes
1answer
119 views

Converting a ppm file into ASCII art [closed]

I'm trying to write a code for converting a ppm image into ASCII art. I've written my code but this is not working properly. In fact, it's showing something clearly different from the original image. ...
1
vote
3answers
538 views

Converting ppm file from P3 to P6 using C

I am trying to write a program that converts a p3 PPM file to P6 using C. But I am running into two problems. 1, I am getting a segmentation fault in my code. and 2, the header isn't being properly ...
1
vote
1answer
27 views

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

Write a PPM file with C++ and get distorted result

I have to read, modify and write a PPM image. I tried to check if I got all the data of the PPM image in my array right by trying to write it to a new file. But the image i got looks like a broken TV:...
0
votes
0answers
34 views

point pattern packages and fitting integer in ppm

enter image description hereI ve been working with point pattern data and trying analyze it. I have few questions, I googled them but couldn't find a post with everything so this would be helpful for ...
-5
votes
1answer
139 views

what does the *& mean in :void setData(const Color * & data_ptr);

This is probably a dumb question but since i am new to programming and especially c++ i figured i would ask here.I have the following method inside a class: /*! Copies the image data from an external ...
0
votes
3answers
191 views

Creating multiple Instances of Custom Class in C++

Basically what title says. I have a Custom named class Color with this constructor: Color(component_t r, component_t g, component_t b) : r(r), g(g), b(b) { } The Class "Image" i'm working on ...
0
votes
0answers
245 views

Read ppm P6 image, store into an array and print the array C++

I'm pretty new to programming so excuse my ignorance. I've been trying to store a ppm file into an array and then print whatever i have stored. I am expecting to see numbers from 0 to 255. I don't ...
0
votes
0answers
152 views

Reading binary data from a ppm file [duplicate]

struct RGB { int r, g, b; }; RGB operator>>(std::ifstream& in, RGB& rgb) { in >> rgb.r; in >> rgb.g; in >> rgb.b; return rgb; } std::ostream& ...
0
votes
1answer
473 views

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 ...
0
votes
2answers
109 views

What am I doing wrong when executing the sobel filter function in c++

Here is my sobel filter function performed on a grayscale image. Apparently I'm not doing my calculations correct because I keep getting an all black image. I have already turned in the project but ...
0
votes
1answer
72 views

installation of bugzilla fails on windows 10 showing error 500 [closed]

THE FOLLOWING ERROR IS SHOWING UP: D:\Programs\XAMPP\htdocs\test\bugzilla-5.0.3>ppm install TimeDate Downloading ActiveState Package Repository packlist...not found ppm install failed: Can't find ...
0
votes
1answer
48 views

performance of rho2hat and ppm in spatstat

I want to compare the performance of nonparametric intensity function estimator "rho2hat" with "ppm". My question how can I perform a test to see estimation works better? I couldn't use quadrat.test?
0
votes
0answers
67 views

Questions about transformation, normalization and ppm files in fractals

I've 3 questions about a program I'm working on. The first is my transformation method correct? While at large scale it seems fine, at smaller ranges it appears to drift—suggesting an error of some ...
-2
votes
1answer
74 views

Converting a PPM from RGB to HSL in C__

I have some code samples in C. I need to do the histogram equalization. However, I need to forward step by step. I was stucked in first step. First step is to convert the file from RGB to YCbCr.So, I ...
-5
votes
1answer
457 views

Converting a PPM from RGB to HSL in C [closed]

I need a help about histogram equalization in RGB image files for my academic coursework. I checked my previous code samples about histogram equalization and I did not find any clue about this issue....
0
votes
2answers
107 views

Segmentation fault while reading PPM

Could anybody please tell me why am I getting a segmentation fault when running this code? I am trying to open a PPM file with P6 format, on the second line there is its dimension, on the third line ...
0
votes
2answers
79 views

How to rotate and prevent unwanted coloring of black and white image imported into R

Background: I'm trying to follow the steps on this post I have downloaded the image, and made it accessible here. It is saved in the R directory as baboon.png: Now from R studio I have library('png'...
-1
votes
1answer
36 views

C++: Issues with manipulating a PPM file

I'm working on a program that can perform various effects and manipulations on a PPM file. However for testing reasons, it uses cin rather than an input file. It is supposed to be able to perform ...
0
votes
1answer
406 views

Storing all the values of a PPM P3 file

I am "attempting" to store P3 PPM files using C but I'm not all that experienced with it so I've hit a brick wall. I was wondering if anyone could help me in accomplishing my task. Thank you. I ...
0
votes
1answer
515 views

C++ reading/writing PPM image files graying out image

I'm trying to write a program to read ppm images, store them as objects, and write them out again. Ideally, I would like to store the pixels as int type objects, but I can only get even similar images ...
0
votes
1answer
332 views

How do you read pixel data from a PPM (P3) image into a Matrix in C?

I would like a matrix with each row corresponding to a pixel and each column being an R G B value from a PPM P3 image. I attempted to create a Matrix with [imageWidth * imageHeight] [3] as the size ...

http://mssss.yulina-kosm.ru