Sign in to follow this  
null;

Splitting an image into chunks of a specified size?

Recommended Posts

I was just wondering how exactly I would go about splitting a single image into multiple images of a specific size.

 

Essentially, I would just take a regular image, and split it into, say, multiple images which are 16x16.

 

I looked online for an answer, but my search terms were probably a bit messed up since the only stuff I could find was splitting it into specified rows and columns (not specifying the actual desired size of the output image).

 

Is there a standard algorithm for splitting an image into smaller parts of the desired size?

 

Thanks!

 

EDIT: I really need to try harder before asking. Sorry! It was really easy to do, but I just missed it somehow. But please, feel free to answer. I might learn something new!

Edited by Debz

Share this post


Link to post
Share on other sites

EDIT: I really need to try harder before asking. Sorry! It was really easy to do, but I just missed it somehow.

Care to share? In case others find this thread by searching :)

Share this post


Link to post
Share on other sites

 

EDIT: I really need to try harder before asking. Sorry! It was really easy to do, but I just missed it somehow.

Care to share? In case others find this thread by searching :)

 

Well, the heart of it is essentially creating a BufferedImage with the paramters of (specified width, specified height, image type).

 

The rest consists of basic loops which really anyone with beginner knowledge can do  : P For some weird reason, I didn't try that in the first place even though it's extremely simple.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this