logankilpatrick
logankilpatrick

Reputation: 14551

How to use JuliaImages to create a smaller image given a starting image?

I just got done exploring the docs for JuliaImages found here. What I want to do is as follows:

I have an image. It is a map of sorts. It takes up a lot of space so I want to index into the image and create a new smaller image that is just essencially a zoomed-in version of the original image. I know I could do this manually, but I want to create a re-usable script that I can use to apply this operation to N number of images. How can I do this using JuliaImages?

Upvotes: 0

Views: 115

Answers (1)

tholy
tholy

Reputation: 12179

If by "zoomed in" you mean focusing on a small portion of the image and making it look bigger, you can do this with ordinary array-indexing tools. For example, img[251:500,147:328] would extract a portion of the image.

If what you're really looking for is a thumbnail, my favorite approach is to use restrict. That is limited to 2-fold reductions. You can also imfilter (best with the IIRGaussian filters of ImageFiltering.KernelFactors) and then call imresize. But there will be no beating the performance of restrict.

Upvotes: 2

Related Questions