You can use the add_image_size()
function with the after_setup_theme action hook to generate a new image size.
function wp768_custom_image_size() {
add_image_size('my_custom_image_size', 250, 250);
}
add_action('after_setup_theme', 'wp768_custom_image_size');
And you can use the following size in the template similar to like this.
if( has_post_thumbnail() ) {
the_post_thumbnail( 'my_custom_image_size' );
}