I’m working on a project based on ARToolkit and I need to resize and print the markers provided with the library (here an example https://dl.dropboxusercontent.com/u/5049281/static/BchThin-0010.png). Each marker image files is stored in a really small file (8x8 pixels) and I need to resize it without lose resolution. If I try to do it with a common image viewer (like anteprima on a mac) white pixels and black pixels will blend together making the marker unusable.
Switching to OF, if I load the image using ofImage and I try to resize it with myofImage.resize will happen the same thing (image resized1).
This is the code I used:
ofImage marker; int newWidth = marker.getWidth * 100; int newHeight = marker.getHeight * 100; marker.loadImage("pathToImage/BchThin_0010.png"); marker.resize(newWidth,newHeight);
If I try with ofPixels, using this code
ofPixels pixels; ofImage markerLarge; pixels.setFromExternalPixels(marker.getPixels(), marker.getWidth(), marker.getHeight(), 3); pixels.resize(newWidth, newHeight); markerLarge.setFromPixels(pixels);
I’ve better result (image resized2), black and white are not blended, but black border seem cut;
What should I try?
thanks in advance