This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

HP_Julianum
HP_Julianum presents ...

2013/4/10

picture manipulation including run length encoding

This little project is showing some easy picture manipulation functions, that have been implemented in one of my courses in high school (color separation, blurring, mosaik, mirroring, rotation, histograms).
The smilie is the reset-button!
One of my goals has been to implement a possibility to easily show the result of run length encoding in a 1 bit monochrom picture. Clicking on the black and white actor transforms the background image into a monochrom image and adds a small box and a bigger zoombox (after dragging the little box). The zoomfactor is 8. Move around the small box until you find an appropriate spot on the picture. Releasing the mouse adds an additional actor, that shows the result of run length encoding. The first two numbers denote the amount of pixels horizontally and vertically. The following text-string is showing the result of the run length encoding, whereas the "B" means "black" and "W" means "white". The memory requirements with or without run length encoding are being calculated.

2647 views / 8 in the last 7 days

3 votes | 0 in the last 7 days

Tags: simulation demo run image education manipulation length encoding

Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Wed Apr 10 15:59:09 UTC 2013
nightwingx13nightwingx13

2013/4/17

Awesome, i can't even imagine how you did this and how long take it
JetLennitJetLennit

2013/4/18

It broke when i clicked on the banana a bunch......
HP_JulianumHP_Julianum

2013/4/19

Hi, nightwingx13. The preparations for my lessons took about 5-6 hours, that means developing the main program. As a matter of fact the biggest problem I had to face was the missing editor-actor of greenfoot. So I had to calculate the width of the string and to figure out the height of each row. Therefor you cannot find a scrollbar or something like that in the used actor. This should be a very welcome new feature of greenfoot for all the projects, that want to use the easy world-class but nevertheless need a class for simple text output.
HP_JulianumHP_Julianum

2013/4/19

Hi, JetLennit I cannot find a fault in the implementation of my "banana"-actor. As a matter of fact the background-image is just doubled horizontally and vertically each time it is clicked. Would you mind trying again...?
danpostdanpost

2013/4/19

There is an error occuring when you click on the banana ten times. It just causes the scenario to stop on the site (just click run to re-start). Possibly it is trying to create an image of size (0, 0) or less. A simple check could prevent this.
A new version of this scenario was uploaded on Sun Apr 21 18:00:22 UTC 2013 little improvement in showing the result of run length encoding
A new version of this scenario was uploaded on Mon Apr 22 09:32:07 UTC 2013 I changed the algorithm for the mosaic (banana-button) from doubling the image each time to just increasing the number of images per level by one. Moreover I added an "if" to prevent the project from freezing. For my goal it is sufficient to show this function with a maximum level of 10. Thanks for the comments on this issue.
JetLennitJetLennit

2013/4/22

You should add a save image button
JetLennitJetLennit

2013/4/22

If you hit the orange around 16 times then hit any of the color buttons it makes everything but the center circle black

See all comments

Want to leave a comment? You must first log in.

Who likes this?

JetLennit Moritz Duta