Task 084: artistic image filters - Impressionism

The challenge is to design and implement an algorithm that calculates the effect of an artistic image filter on a given raster image. The result should be similar to an impressionist painting techniques, e.g. a simulation of pointilism.

Pointilism

Overview

The template application 084filter from the repository grcis serves as the basis of this project. This is a simple application in which it is possible to load an input image, enter a text parameter, and generate an output image. Within the application, the method Filter.Recompute() is responsible for calculating the output image. This method must be re-written, and the relevant location in the source Filter.cs indicated via comment brackets:

  // !!!{{
  // !!!}}

Technical details

The method Filter.Recompute() has the following parameters:
  • Bitmap input input file (if this is null, the function must properly deal with that case)
  • string param - an optional string parameter. If you use it, you'll have to define yourself what it can contain, and in and in what format (the pilot implementation uses rectangular cell size - one or two numbers separated by a comma)
The return value is calculated image in Bitmap format, and may be null.

Programming details

The sample application demonstrates several technical aspects:
  1. create an instance of output raster image in the fixed format of Format24bppRgb
  2. vquick access to binary data pixels - using methods Bitmap.LockBits() and unsafe blocks that indicate access to a locked memory block (a slow alternative to / with another algorithm / is also available)
  3. calculation in a separate thread - with the appropriate frequency in cycles, it is possible to control the value of the global logical variable Form1.cont (if this is set to false the algorithm should shut down as quickly as possible)
  4. Drag & Drop input image - the input file can be transferred in the form of mouse dragging from any Windows application that supports D & D

Infrastructure

If you need functions for conversion between RGB and HSV, please refer to the file common/MathSupport.cs. Greyscale conversion functions can be found in common/RasterDrawing.cs

What to hand in

You have to send us the file Filter.cs.
In the first line, put your name in a comment
In the procedure InitParams() you can read any parameters you need.
If you use this string parameter param as input, do not forget to define and describe its semantics.
If you are using images to drive the input, and if you have achieved a nice result with a particular input image, you can also send us that image. But please watch the size of the mail attachment, and use some web upload service if it is too large (Dropbox, GoogleDrive, uloz.to), and just send us the URL instead.

Also, when submitting the file, please make sure that it includes meaningful comments that describe the algorithm you chose: how you chose it, where you found information on it (literature), or which application inspired you (PhotoShop, GiMP, ..). You should also clearly describe what the intended results of the filter are!

Deadline

Hand in until: 6. 12. 2015

Points

Basis: 8 points, bonus up to 6 points.

Project

Visual Studio project: 084filter.

Source file

Modify and hand in the source file: Filter.cs
As a comment in the first line, please include your name!

Data

Your algorithm should work on any input image. For test purposes, you can use images from the repository directory data, and also the images sail.png, silverstone-17671.png, maran-18587.png, monarch.png, skyline129-178-246.png.


Copyright (C) 2015 J. Pelikán & A. Wilkie, last change: 2019-05-09 17:52:59 +0200 (Thu, 09 May 2019)