An important property of any robust steganographic method is that it must introduce minimal distortion in the created stego-images. This objective is achieved if one can maximize the similarity between the pixels value of the cover image and the secret data. In the proposed framework, the maximal similarity is obtained by arranging some routes along the pixel positions. Our novel method is based on dynamic blocking and the genetic algorithm which decreases the distortion produced by a base data embedding method. In the proposed parametric framework, the cover image is first divided into several horizontal static-size strips. Then each strip is partitioned into some dynamic-size blocks. The size of each block is determined using the genetic algorithm such that minimal distortion is produced. Traversing the blocks of a strip in a raster scan manner, the route for embedding the data into the strip is obtained. The best route is considered to be the one which partition a strip into different blocks with different sizes. The embedding route is raster scan of the partitioned blocks. In our framework, only the sizes of the blocks need to be recorded as the overhead instead of the routes. The experimental results evaluated on 2000 natural images using several steganalytic algorithms demonstrate that our proposed method decreases the image distortion and thus enhances the security.