Jump to content
  • Advertisement
Sign in to follow this  
null;

Splitting an image into chunks of a specified size?

This topic is 693 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!