• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

little help with assignment - java program that reads/writes image/pixel data raw.:-(

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi There
I am looking for a push in right direction in relation to an assignment (ref below). I've got the read bit ok (i.e image into an array that is RGB no-alpha), but just a little unsure about what is next.

Please help :-)

==================================================================

Write a Java program which reads an image in a popular format and saves the pixel data in a raw format. The program must be command line based with two arguments: the first argument is the image file in a popular format and the second argument specifies the file you save your raw image data with extension raw. The first line of the raw format file must be "grey image" if the image is grey or "colour image" if the image is colour. The second line must specify the dimension in two fields: the first field represents the width and the second field represents the height. An example metadata of the raw format is as follows:

colour image
256 256

The second part of the assignment requires you to develop your own Java image codec which can compress the raw format images of part A (above). The encoder can be very simple one however it must contain at least the following:

a) Transform coding stage
b) Quantization stage
c) Entropy coding stage

The compressed image must be saved to a file with extension jif. Any parameters you used for the compression must be saved except those parameters which don?t depend on a particular image. A corresponding decoder program must also be produced.
===================
-Cheers
Craig :-)
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, in the second half of part "A", you'd open a file and write out the data. It sounds like they want a text format, based on the wording. So you could use a PrintWriter wrapping a FileWriter, write the two header lines, and then just write the pixel values for each row on successive lines.
 
java nubee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yer
Wasn't sure to use ImageIO.write class or a binary IO.

Hmmmm....
reply
    Bookmark Topic Watch Topic
  • New Topic