Put some background pixel into top and bottom of a image

2 views (last 30 days)

I have a image like this and I want to put some background pixels to top and bottom of the image. How to do this??

Answers (1)

Image Analyst
Image Analyst on 23 Oct 2016
Expand the canvass with padarray(). Then use copy and paste, like my attached demo.
  2 Comments
Malan Jayanka
Malan Jayanka on 23 Oct 2016
Edited: Malan Jayanka on 23 Oct 2016
Expand the canvass with padarray() mena this?
And also this code is work only for gray scale images??how to do this with RGB images??
Image Analyst
Image Analyst on 23 Oct 2016
The newly attached version also handles color and indexed images.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!