Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8585179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:59:43+00:00 2026-06-11T21:59:43+00:00

In java…I have an integer array of RGB pixels, means output of my program

  • 0

In java…I have an integer array of RGB pixels, means output of my program is as follows:
‘

Pixel 1: 255 200 191 231
Pixel 2: 255 237 028 036
Pixel 3: 255 034 177 076
Pixel 4: 255 085 140 066
Pixel 5: 255 200 191 231
Pixel 6: 255 237 028 036
Pixel 7: 255 231 188 167
Pixel 8: 255 237 028 036
Pixel 9: 255 237 028 036
Pixel 10: 255 063 072 204
Pixel 11: 255 226 125 144
Pixel 12: 255 063 072 204
Pixel 13: 255 200 191 231
Pixel 14: 255 062 187 099
Pixel 15: 255 255 127 039
Pixel 16: 255 255 127 039
Pixel 17: 255 200 191 231
Pixel 18: 255 212 177 189
Pixel 19: 255 063 072 204
Pixel 20: 255 040 158 100
Pixel 21: 255 034 177 076
Pixel 22: 255 237 028 036
Pixel 23: 255 248 253 249
Pixel 24: 255 165 169 231
Pixel 25: 255 200 191 231

How can I create image of size 5 x 5 image using the above data…?’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:59:44+00:00Added an answer on June 11, 2026 at 9:59 pm

    Creating a BufferedImage
    getting the Graphics/Graphics2D object from the BufferedImage
    and painting with the Graphics object the pixels.

    The BufferedImage can be stored as a File with ImageIO or displayed in an Own Component/JComponent

    A Bit Pseudo code

    BufferedImage bi = new BufferedImage(5,5,BufferedImage.TYPE_INT_ARGB);
    Graphics2D g = (Graphics2D) bi.getGraphics();
    while(i < 25){
      g.setColor(new Color(See Api for more details on how to create a Color);
      g.drawRect(i/5, i%5, 1,1);
    }
    

    Now you have a BufferdImage to be saved with ImageIO

    ImageIO.write(bi, "png", new File(output));
    

    Or get a New JComponent and overwrite its paint Method. There are plenty resources for this task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Java. I have a very small int array (4 elements). What's the fastest way
Java script has many falsy values as I started learning. I have a program
Java generics are implemented using type erasure. That means that if I have a
Java noob question: Consider the following C array and initializer code: struct { int
Java newbie here, I am trying to find the output of the following chunk
Java design question. I have an object that needs to maintain sets of say
Java Exception: http://hastebin.com/yiwecefifi.avrasm I have an object, that I call Category, that my fragment
Why does the Android system throw this Exception? 05-18 12:33:44.169 W/System.err( 8230): java.io.IOException: Is
Java 1.5, Linux I do have a screen which contains different textareas and textfields.
Java can't do operator overloading, but + works okay for String and Integer and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.