12. July 2013

How to decode stereogram by Photoshop

Stereograms are funny. Some stereograms are very easy. Sometimes it’s very hard to decode the content of stereogram.

If you can’t see the content of stereogram there is still way how to see it. You can use Photoshop.

Here is stereogram (Magic Eye Picture) created by Easy stereogram builder.

stereogram-sampleOpen the file in Photoshop. Select whole content and copy it into new layer (CTRL+A, CTRL+C, CTRL+Shift+N, CTRL+V).

Right click on the newly created layer and choose Blending options, set Blend Mode to Difference. The image should change to complete black.

photoshop-blending-options

Change to Move tool (press V) and start moving with the new layer to the right. After small move image should appear.

stereogram-photoshop-resultEasy :-)

You can play with further Photoshop filters to produce a better result.

4. May 2013

How to stitch maps by Photoshop

Photoshop is very handy tool when you need to stitch several images together. It is also possible to stitch maps from smaller images into one bigger. This is useful when you’re planning trip somewhere and you do not have a paper map. You can create screenshots from OpenStreetMap and stitch them together in Photoshop.

Step 1. Create screenshots of maps and store these files it into directory. Images should overlap. Use PNG format to avoid blur in images.

Windows users can use Snipping tool. Mac users can use Command + F4.

snipping-tools

Step 2. Open Photoshop. Go to menu FileAutomatePhotomarge

photomerge-01

Step 3. Select files LayoutReposition. Uncheck Blend Images Together. Browse files or folder. Click Ok and wait.

photomerge-02

If overlap region of screenshots was sufficient then result image will be ok.

6. December 2011

Fine tune three.js export from Blender

Three.js exporter for new version of Blender 2.60 supports many features. The problem is that default exporter settings generates quite big JSON file even for small models.

Here is list of defaut options for save model function from export_threejs.js:

         filepath = "",
         option_flip_yz = True,
         option_vertices = True,
         option_vertices_truncate = False,
         option_faces = True,
         option_normals = True,
         option_uv_coords = True,
         option_materials = True,
         option_colors = True,
         align_model = 0,
         option_export_scene = False,
         option_lights = False,
         option_cameras = False,
         option_scale = 1.0,
         option_embed_meshes = True,
         option_url_base_html = False,
         option_copy_textures = False,
         option_animation = False,
         option_frame_step = 1,
         option_all_meshes = True

These are good settings when you want to save all objects from scene. It is quite overkill when you need to save just one dynamically generated object. I recommend to turn off following options:

option_all_meshes, option_materials

Here is sample code in Python which will select object by name and save it to file with defined options:

import bpy

bpy.ops.object.select_name(name="ObjectName")
bpy.ops.export.threejs(filepath="ObjectName.js", option_all_meshes=False, option_materials=False)

Further articles about Blender and Python are located under the tag Blender on my blog.

Enjoy :)

27. June 2011

Quick start: Blender and Python

If you know right tricks then writing scripts for Blender is quite easy.

Here is video tutorial that explains some of those tricks. Enjoy.

22. June 2011

Create mesh with correct faces in Blender by Python script

This video tutorial explains how to create mesh using Python script.

Vertices must be defined in right order when we want to define correct face.

Let’s imagine that we would like to create following object:

Numbers are marking vertices beginning from 0.

Let’s define them:

faces = ((0,1,2,3), (1,2,6,5), (1,0,4,5), (2,3,7,6), (0,3,7,4), (4,5,6,7)

Just display normals to see whether everything is ok.

As you can see, only few faces have correct normal.

In order to define face correctly use following rule:

Imagine that you’re sitting inside object and you’re looking outside.

You have to define face by naming vertices in clockwise fashion.

Solution is:

faces = ((0,1,2,3), (5,6,2,1), (4,5,1,0), (2,6,7,3), (0,3,7,4),(7,6,5,4))

For more details about Python and Blender pay a visit to blendercookie.com.