#!/usr/bin/env python

import sys
import argparse
from image_slicer import slice, save_tiles, get_basename


def main():
	"""Parse arguments and slice image."""
	parser = construct_parser()
	args = parser.parse_args()
	tiles = slice(args.image, args.num_tiles, save=False)
	save_tiles(tiles, prefix=get_basename(args.image), directory=args.dir,
		   format=args.format)

def construct_parser():
	"""Return an ArgumentParser."""
	parser = argparse.ArgumentParser(prog='slice-image',
					 description='Slice an image into tiles.',
					 epilog='Report bugs and make feature requests at https://github.com/samdobson/image_slicer/issues',
					 add_help=False
		 )

	required = parser.add_argument_group('Required Arguments')
	required.add_argument('image', help='image file')
	required.add_argument('num_tiles', type=int,
			      help='number of tiles to make')

	optional = parser.add_argument_group('Optional Arguments')
	optional.add_argument('-d', '--dir', default='./',
			      help='output directory')
	optional.add_argument('-f', '--format', default='png',
			      help='output image format (e.g JPEG, PNG, GIF)')
	#parser.add_argument('-e', '--exact', action='store_true',
	#		    help='Enlarge some tiles to produce the exact number')

	info = parser.add_argument_group('Info')
	info.add_argument('-h', '--help', action='help',
			  help='display this screen'),
	info.add_argument('-v', '--version', action='version',
			  version='%(prog)s 0.2')

	return parser

if __name__ == '__main__':
	main()


a31736f51cf7a3ec7882e0213408bf1757dc89e5
<mask token>


def main():
    """Parse arguments and slice image."""
    parser = construct_parser()
    args = parser.parse_args()
    tiles = slice(args.image, args.num_tiles, save=False)
    save_tiles(tiles, prefix=get_basename(args.image), directory=args.dir,
        format=args.format)


<mask token>

<mask token>


def main():
    """Parse arguments and slice image."""
    parser = construct_parser()
    args = parser.parse_args()
    tiles = slice(args.image, args.num_tiles, save=False)
    save_tiles(tiles, prefix=get_basename(args.image), directory=args.dir,
        format=args.format)


def construct_parser():
    """Return an ArgumentParser."""
    parser = argparse.ArgumentParser(prog='slice-image', description=
        'Slice an image into tiles.', epilog=
        'Report bugs and make feature requests at https://github.com/samdobson/image_slicer/issues'
        , add_help=False)
    required = parser.add_argument_group('Required Arguments')
    required.add_argument('image', help='image file')
    required.add_argument('num_tiles', type=int, help='number of tiles to make'
        )
    optional = parser.add_argument_group('Optional Arguments')
    optional.add_argument('-d', '--dir', default='./', help='output directory')
    optional.add_argument('-f', '--format', default='png', help=
        'output image format (e.g JPEG, PNG, GIF)')
    info = parser.add_argument_group('Info')
    info.add_argument('-h', '--help', action='help', help='display this screen'
        ),
    info.add_argument('-v', '--version', action='version', version=
        '%(prog)s 0.2')
    return parser


<mask token>

<mask token>


def main():
    """Parse arguments and slice image."""
    parser = construct_parser()
    args = parser.parse_args()
    tiles = slice(args.image, args.num_tiles, save=False)
    save_tiles(tiles, prefix=get_basename(args.image), directory=args.dir,
        format=args.format)


def construct_parser():
    """Return an ArgumentParser."""
    parser = argparse.ArgumentParser(prog='slice-image', description=
        'Slice an image into tiles.', epilog=
        'Report bugs and make feature requests at https://github.com/samdobson/image_slicer/issues'
        , add_help=False)
    required = parser.add_argument_group('Required Arguments')
    required.add_argument('image', help='image file')
    required.add_argument('num_tiles', type=int, help='number of tiles to make'
        )
    optional = parser.add_argument_group('Optional Arguments')
    optional.add_argument('-d', '--dir', default='./', help='output directory')
    optional.add_argument('-f', '--format', default='png', help=
        'output image format (e.g JPEG, PNG, GIF)')
    info = parser.add_argument_group('Info')
    info.add_argument('-h', '--help', action='help', help='display this screen'
        ),
    info.add_argument('-v', '--version', action='version', version=
        '%(prog)s 0.2')
    return parser


if __name__ == '__main__':
    main()

import sys
import argparse
from image_slicer import slice, save_tiles, get_basename


def main():
    """Parse arguments and slice image."""
    parser = construct_parser()
    args = parser.parse_args()
    tiles = slice(args.image, args.num_tiles, save=False)
    save_tiles(tiles, prefix=get_basename(args.image), directory=args.dir,
        format=args.format)


def construct_parser():
    """Return an ArgumentParser."""
    parser = argparse.ArgumentParser(prog='slice-image', description=
        'Slice an image into tiles.', epilog=
        'Report bugs and make feature requests at https://github.com/samdobson/image_slicer/issues'
        , add_help=False)
    required = parser.add_argument_group('Required Arguments')
    required.add_argument('image', help='image file')
    required.add_argument('num_tiles', type=int, help='number of tiles to make'
        )
    optional = parser.add_argument_group('Optional Arguments')
    optional.add_argument('-d', '--dir', default='./', help='output directory')
    optional.add_argument('-f', '--format', default='png', help=
        'output image format (e.g JPEG, PNG, GIF)')
    info = parser.add_argument_group('Info')
    info.add_argument('-h', '--help', action='help', help='display this screen'
        ),
    info.add_argument('-v', '--version', action='version', version=
        '%(prog)s 0.2')
    return parser


if __name__ == '__main__':
    main()

#!/usr/bin/env python

import sys
import argparse
from image_slicer import slice, save_tiles, get_basename


def main():
	"""Parse arguments and slice image."""
	parser = construct_parser()
	args = parser.parse_args()
	tiles = slice(args.image, args.num_tiles, save=False)
	save_tiles(tiles, prefix=get_basename(args.image), directory=args.dir,
		   format=args.format)

def construct_parser():
	"""Return an ArgumentParser."""
	parser = argparse.ArgumentParser(prog='slice-image',
					 description='Slice an image into tiles.',
					 epilog='Report bugs and make feature requests at https://github.com/samdobson/image_slicer/issues',
					 add_help=False
		 )

	required = parser.add_argument_group('Required Arguments')
	required.add_argument('image', help='image file')
	required.add_argument('num_tiles', type=int,
			      help='number of tiles to make')

	optional = parser.add_argument_group('Optional Arguments')
	optional.add_argument('-d', '--dir', default='./',
			      help='output directory')
	optional.add_argument('-f', '--format', default='png',
			      help='output image format (e.g JPEG, PNG, GIF)')
	#parser.add_argument('-e', '--exact', action='store_true',
	#		    help='Enlarge some tiles to produce the exact number')

	info = parser.add_argument_group('Info')
	info.add_argument('-h', '--help', action='help',
			  help='display this screen'),
	info.add_argument('-v', '--version', action='version',
			  version='%(prog)s 0.2')

	return parser

if __name__ == '__main__':
	main()

