473,378 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How can I scale a BufferedImage

Good evening.

I want to read a .jpeg into a BufferedImage with anImageReader.read(0,
param) that I would then like to reduce (make a thumbnail more or less) and
save as another file with anImageWriter.write(aBufferedImage).

My (theoretical) options seem to be to reduce it while I'm reading it,
reduce it from the BufferedImage, or reduce it while I'm writing it.

BufferedImage is of course a subtype of Image and Image has a
getScaledInstance method that does what I want. The main problem is that
getScaledInstance returns an Image and anImageWriter.write requires a
BufferedImage.

Addtionally, I read that getScaledInstance is quite slow and otherwise for
some unexplained reason not preferred. I also suspect that an elegant way
exists that I haven't been able to find after 2 days of searching.

Any help would be appreciated.

Ron.

Jul 17 '05 #1
0 2328

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael Johnston | last post by:
I am saving a BufferedImage as a JPEG file under Windows XP. I am using the JAI JPEGImageEncoder class. The JPEG is saved as CMYK but I need RGB. I cannot figure out how to get RGB. Any help?
4
by: codecraig | last post by:
Hi, I am using Tkinter and I have a Label and a Scale. I want to update my label everytime the Scale value changes. What is the best way of doing this? Do i have to bind for every event type? ...
3
by: Jerry Spence1 | last post by:
A very useful feature was added in 2.0 of .NET framework which was the scaling of a form and all the controls within it. This is really useful but I am finding very little information of how to use...
0
by: TonyJ | last post by:
Hello! We have a pc running a form application. If I push some buttons in this application I want to send some commands to a scale which is connected to a specific IP address. When I sent a...
1
by: Manticure | last post by:
I want to get the R, G and B components as integers (0-255). I use this: Rectangle area = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); BufferedImage bufferedImage =...
0
by: madumm | last post by:
Hi All; String newImagePath = "C:\temp\abc.bmp" File filePath = new File(newImagePath); Image watermarkImg = Toolkit.getDefaultToolkit().getImage(filePath.toURL()); Any how i want convert...
3
by: eagles | last post by:
I'm trying to save a BufferedImage as a .tiff. The following: ImageIO.write(bufferedImg, "TIFF", new File("file.tiff")); is returning false. Do I need to use JAI? I'm just trying to use the...
0
by: dishal | last post by:
I have a whiteboard I'm working on at the moment but I have no idea how i should transport the user's input on the canvas to the recipient. Someone suggested using BufferedImage. Can anyone please...
19
by: Matteo Migliore | last post by:
Hi! I've to scale a vector of numbers of size N to a vector of size M. The trasformation is like a zoom on images but I need on a vector. The second size can be M >= N or M <= N, M 0. The...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.