Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How do I apply my beginner java skills to my first original program

  1. #1
    Junior Member
    Join Date
    Aug 2018
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How do I apply my beginner java skills to my first original program

    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

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: How do I apply my beginner java skills to my first original program

    reduce the number of colours in the image to a pre defined
    Do you have an algorithm for doing that?

    Given that, the program looks straight forward.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 5
    Last Post: July 3rd, 2014, 10:44 PM
  2. Replies: 3
    Last Post: September 7th, 2013, 02:34 AM
  3. Great Company Needs Java Skills in San Francisco area
    By Bill Law in forum Paid Java Projects
    Replies: 2
    Last Post: August 22nd, 2013, 12:34 AM
  4. [SOLVED] Trying to apply methods to sequential program. Getting error.
    By Praetorian in forum Object Oriented Programming
    Replies: 0
    Last Post: May 4th, 2013, 11:26 PM