Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

increasing the size of the image that is created by this program?

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



How can I increase the size of the image that is created by this program?
 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can just put each value in multiple times (for example, to make it 2x bigger, put each value in 4 times - 2x in the horizontal and 2x in the vertical). Or you could try to get a smoother zoom by using interpolation of values. This website provides some little bit of details on image interpolation and should provide at least enough information for further research.
 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't get the point may you give me example?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12087
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well...if instead of outputting each point once, you output it twice, the picture should be twice as big. However, since pictures are two dimensional objects, you need to stretch it in both directions. the simplest way is to repeat the data you have. so this:

...O..O...
.....O.....
............

would become this:

......OO....OO......
......OO....OO......
..........OO..........
..........OO..........
.........................
.........................


The problem is that if you do this too many times, your image becomes VERY blocky - like when you zoom in on a picture on a computer. You may be able to interpolate the data points. I.e. if your original data is 0, 100,0, you may be able to calculate data points 'between' the original one, giving you something like 0,50,100,50,0 - which would give a smoother picture.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic