Questions tagged [pgm]

PGM is a grayscale image format used by the Netpbm library and other graphics software.

Portable Gray Map (PGM) is a simple image format for grayscale images.

The format allows data to be stored in either ASCII or binary format. PGM 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).

175 questions
2
votes
1 answer

simple raw binary image file format

I'm looking for a raw image file format as simplistic as PGM, but encoded in binary, so that I can write pixels in bursts. I've searched over Wikipedia and Google and found none that didn't start to have complex headers and such. Can anybody…
Catalin Vasile
  • 367
  • 5
  • 17
2
votes
2 answers

Create JavaFX Image from PGM or TIFF as fast as possible

I'm capturing images from a scanner device with java. The input format ist PGM or TIFF. I have to show up live results in the user interface. Actually I'm using ImageJ to read the source input stream as tiff, because ImageJ can also handle…
user3529469
2
votes
2 answers

char ** array c file input pgm

I'm having some issues with a char** with file input. I'm doing a project where we are manipulating PGM files. I'm trying to get the header from the file using a char** but all it does is return null. It will run through the code that I have get the…
kevorski
  • 816
  • 1
  • 11
  • 29
2
votes
2 answers

Matlab is saving matrix as image with different values

I have a set of values between 0 and 1. After i put these values between 0 and 255 I want to save them as a grayscale image in pgm format. The problem is the fact that after I save it as an image the values i get when i read the image are different…
mad
  • 2,677
  • 8
  • 35
  • 78
2
votes
2 answers

How to save .PBM image?

I open a pgm file, convert it to numPy array and change all pixels to 0 or 1 (or 255, I don't know how to proceed yet). How can I save it as .PBM using openCV? Like: P1 512 512 0 1 0 0 0 . . 0 0 0 1 0 . . . . . . . . . . . . . . . . . . . . . . .…
Davi Stuart
  • 269
  • 3
  • 16
2
votes
1 answer

Rotating a 2D PGM Image Array in C

I am working on a homework project to rotate a simple 2D array holding RGB values for a PGM file. I've read many posts in these forums about how to do this in C, and I've almost got it working. My output file has the correct dimensions and is…
crgolden
  • 4,332
  • 1
  • 22
  • 40
2
votes
1 answer

read.pnm() - error trying to read pgm image

I'm trying to read a pgm file in R. I set my wd to where the image is and then simply try to read it: setwd("~/3 Diplomado/5 Multivariado/lfwcrop_grey/faces") library(pixmap) x <- read.pnm(system.file("Aaron_Guiel_0001.pgm",…
JEquihua
  • 1,217
  • 3
  • 20
  • 40
2
votes
2 answers

Writing to PGM file

I am trying to write a pgm file using this code.. myfile << "P5" << endl; myfile << sizeColumn << " " << sizeRow << endl; myfile << Q << endl; myfile.write( reinterpret_cast(image), (sizeRow*sizeColumn)*sizeof(unsigned char)); If I try…
James Hatton
  • 676
  • 2
  • 9
  • 28
1
vote
3 answers

Read and Write PGM (P5) Image File in PHP

In PHP, a simple read and write file can be done by using fread() and fwrite(). The unpack() and pack() operator are used to extract binary information. The question is, how can I read and write PGM (P5) image in PHP without using any additional PHP…
rhzs
  • 516
  • 7
  • 24
1
vote
0 answers

NetMQ PGM dropping packets client-side

I've implemented a PGM publisher/subscriber setup. The server receives data from a TCP connection to another server, and distributes it to clients using the PGM protocol. However, after logging the data on both server and client it would seem the…
Mike
  • 21
  • 1
1
vote
1 answer

How to load PGM (Portable Gray Map) file in openlayers?

i want load a PGM file into openlayers 7, but i don't know how to load it. i found there is a project on github "ol4pgm", but it‘s last update is already 8 years ago. or may be i should convert pgm file to many points and use webgl point layer? or…
steve
  • 11
  • 2
1
vote
2 answers

How could a hidden text message be extracted and displayed from a .pgm file?

I was trying to open and read through a P5 .pgm (grayscale) file, then extract the least-significant-bit from each pixel. I tried to get the LSB of every pixel, so one bit bit per byte of the image.So it would take 8 image bytes/pixels to extract 1…
brocoli
  • 23
  • 5
1
vote
0 answers

mp4 video of a simulation is being skewed horizontally

I recently began programming a simulation for one of my high school classes. I have never worked in c++ before so I really should've done some practice programming first. Bear in mind this means my program is quite disorganized due to a rocky…
1
vote
0 answers

How to load a PGM image with correct color range in Java?

I'm doing a work in which I have to load a PGM image in Java programming language. I have no problems in loading it from a file, since I'm using Apache Sanselan framework and it's too easy to do: BufferedImage image = Sanselan.getBufferedImage(new…
eze.scaruli
  • 1,207
  • 1
  • 13
  • 19
1
vote
1 answer

Is there a proper way to convert common picture file extensions into a .PGM "P2" using PIL or cv2?

Edit: Problem solved and code updated. I apologize in advance for the long post. I wanted to bring as much as I could to the table. My question consists of two parts. Background: I was in need of a simple Python script that would convert common…
Cam
  • 73
  • 5
1 2
3
11 12