expanding 2D matrix by fraction

Thread Starter

aamirali

Joined Feb 2, 2012
412
I have image store in 2D matrix. i.e for each address of TFT I have which bit is set & which is zero.
Consider image as black & white, 1 means pixel on & 0 means pixels off. So i have all the values in 2D matrix.

Now I have to expand this array while printing, this is expansion is both on x & y axis. Like on x axis it should be 1.25 times the original & on y it should be 1.5 times.

How to do that in best way
 

WBahn

Joined Mar 31, 2012
30,086
There are a number of ways to do it and various methods produce better quality results for different types of images. So it is very much a function of the type of image is being represented and what type of information is most important to retain in the scaled up image.
 

WBahn

Joined Mar 31, 2012
30,086
The quickest and easiest way (and the one that will likely give you the poorest results, but if they are good enough, they are good enough) would to simply repeat every 4th column and every other row. So you might try that and see if it is acceptable.
 

WBahn

Joined Mar 31, 2012
30,086
Why would that not work? Try it and see. What does it do that is unacceptable? Often time the way to find a suitable approach is to try approaches that you expect to be unsuitable and examine them closely to find out why they are unsuitable.

Remember, this is YOUR problem. Don't expect others to do all of your work for you.
 

sirch2

Joined Jan 21, 2013
1,037
If all you have is a mono-chrome bitmap then short of line-tracing the graph to create a vector representation of it, all you can sensibly do is repeat the previous pixel.

It would be better to alter whatever creates the graph to give you the correct image resolution in the first place.
 
Top