How to programmatically create an image style?
You're looking for the image_style_save and image_effect_save functions.
An example from the comments on the image_style_save docs page:
$style = image_style_save(array('name' =&gt; 'avatar'));
$effect = array(
  'name' =&gt; 'image_scale',
  'data' =&gt; array(
    'width' =&gt; 64,
    'height' =&gt; 64,
    'upscale' =&gt; TRUE,
  ), 
  'isid' =&gt; $style['isid'],
);
image_effect_save($effect);