Hi Java Community, Thanks for having me.
I am new to java, I have run through several books, so I do understand the java language. I am just having trouble using my new java knowledge to create my first original program. I am still having trouble with the "programming thinking" so its a little bit of a rough road. I have been working on this project for weeks, and really haven't gotten anywhere.
Im hoping you can steer me in the right direction!
The application I want to create, will take an image file and reduce the number of colours in the image to a pre defined Int.
Then I need to get a list of all the colours used in an image, so I can assign them a number for outputting to a text file.
So my method of thinking is....
1. Quantize the image to the required amount of colours. The image will be 8bit, and will only need to be quantized to either 2, 3, 4, 5, 6, 7 or 8 colours
2. get a list of colours used and assign an const to each of them ie. 1,2,3,4,5,6,7,8
3. Output a text file that makes the image into the file format below.
This is the image sample, each colour is a pixel. (this would be the image AFTER being quantized to 3 colours)
Black, white, red, green, blue
blue, white, red, green, blue
Black, white, red, green, blue
blue, white, red, green, blue
The colours would be assigned a const
Black =1
white =2
red = 3
green = 4
blue =5
This information would be converted to an array, that can be printed to a text file. The text file would be the conversion of the image. It will be deliminated by a comma
1,2,3,4,5
5,2,3,4,5
1,2,3,4,5
5,2,3,4,5
I hope this makes sense, and my question is allowable. I am not after written code, I am just asking what i can use to make this happen.
Thanks n advance