# What is the bicubic interpolation function in Julia

**URL:** https://discourse.julialang.org/t/what-is-the-bicubic-interpolation-function-in-julia/14060
**Category:** General Usage
**Tags:** question, images
**Created:** [August 26, 2018, 12:38am UTC](https://discourse.julialang.org/t/what-is-the-bicubic-interpolation-function-in-julia/14060 "2018-08-26T00:38:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![complexfilter](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@complexfilter](https://discourse.julialang.org/u/complexfilter)
#### Post date: [August 26, 2018, 12:38am UTC](https://discourse.julialang.org/t/what-is-the-bicubic-interpolation-function-in-julia/14060/1 "2018-08-26T00:38:26Z")

</div>

I wish to interpolate an image by a factor of 2, both horizontally and vertically. What is the bicubic interpolation operator in Julia that is the counterpart of interp2 in Matlab?

---

<div class="post-metadata">

### Author: ![dfdx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfdx/32/120_2.png) [@dfdx](https://discourse.julialang.org/u/dfdx)
#### Post date: [August 26, 2018, 12:59am UTC](https://discourse.julialang.org/t/what-is-the-bicubic-interpolation-function-in-julia/14060/2 "2018-08-26T00:59:21Z")

</div>

Take a look at [Interpolations.jl](https://github.com/JuliaMath/Interpolations.jl) package which has number of options for configuring interpolation algorithm.

---

<div class="post-metadata">

### Author: ![complexfilter](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@complexfilter](https://discourse.julialang.org/u/complexfilter)
#### Post date: [August 26, 2018, 4:37am UTC](https://discourse.julialang.org/t/what-is-the-bicubic-interpolation-function-in-julia/14060/3 "2018-08-26T04:37:23Z")

</div>

Thanks to the rely. I am currently using:  
using GR  
X = Y = 1:2:512  
Xq = Yq = 1:512  
yy=y1[1:2:512,1:2:512]  
Zq = interp2(X, Y, yy, Xq, Yq, 3)

(here y1 is a 512-by-512 matrix)  
However, the result is slightly different from Matlab’s result.
