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 8842705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:01:42+00:00 2026-06-14T11:01:42+00:00

I am making an image editing like program, and when I want to edit

  • 0

I am making an image editing like program, and when I want to edit large images it really starts to slow down. What is a good way to edit large image quickly? This example adjusts the image’s brightness, it works, but when I get large images such as 3456×2304 its really slow.

I have a slider, which calls this function every time it moves.

// Slider in a dialog box
private void sldBrightnessStateChanged(javax.swing.event.ChangeEvent evt) {
    // Get the position of the slider
    int val = sldBrightness.getValue();
    // Set the text in the textbox
    txtBrightness.setText("" + val);
    // New Brightness class (see below)
    Brightness adjustment = new Brightness();
    adjustment.amount(val);
    adjustment.applyFilter();
    // get the result built by applyFilter();
    Canvas.preview = Preview.getImage();
    // Update main program
    this.getParent().repaint();
}

Then the filter:

package pocketshop.graphics.adjustments;

import java.awt.image.BufferedImage;
import pocketshop.Canvas;
import pocketshop.graphics.Colors;
import pocketshop.graphics.Preview;

public class Brightness{

    protected int amount = 0;

    public void amount(int amount){
        this.amount = amount;
    }

    public void applyFilter(){
        int width = Canvas.image.getWidth();
        int height = Canvas.image.getHeight();
        int[] pixels = new int[width * height];

        Canvas.image.getRGB(0, 0, width, height, pixels, 0, width);
        for(int i = 0; i < pixels.length; i++){
            int pixel = pixels[i];
            //int pixel = Canvas.image.getRGB(x, y);
            int red = Colors.red(pixel);
            int green = Colors.green(pixel);
            int blue = Colors.blue(pixel);

            red += amount;
            if(red > 255){
                red = 255;
            }else if(red < 0){
                red = 0;
            }

            green += amount;
            if(green > 255){
                green = 255;
            }else if(green < 0){
                green = 0;
            }

            blue += amount;
            if(blue > 255){
                blue = 255;
            }else if(blue < 0){
                blue = 0;
            }
            pixels[i] = Colors.rgba(red, green, blue);
        }
        //BrightnessContrastDialog.preview.setRGB(0, 0, width, height, pixels, 0, width);
        BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        img.setRGB(0, 0, width, height, pixels, 0, width);
        Preview.setImage(img);
    }
}
  • 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-14T11:01:43+00:00Added an answer on June 14, 2026 at 11:01 am

    As I understand the picture is presented for user in order to give immediate feedback of changes that are made, what you can do us display downsampled version of picture and perform the brightness change to it while slider is moving which will be fast. Once user is satisfied with the value she selected using slider you can apply the change to original image. You can add apply button or something

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

Sidebar

Related Questions

I'm looking for the fastest way of: merging (it means making one image from
i m making APP which do image proceesing using java SE.i want to check
I'm making a image website with a bunch of images on the website, and
I'm making an image browser where you van edit the name of the image
Which way is better for making image buttons? Using <a> : set background image
I am making App. that includes Picture Editing, After Editing I want to save
I'm making an image gallery and I want to have a bunch of thumbnails
I am making an image gallery, and I need to display images in a
Greetings, Can anybody tells how can I give image distortion effect to images like
What is the best, most effective and yet easiest way of making image captcha

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.