;	script-fu-make-new-RGB-image.scm
;	
;	v 1.2
;	
;	5/19/17
;	
;	© 2017, hnd 
;
;	Allows user to specify width, height, pixel depth, foreground  
;	and background colors when creating a new RGB image 
;	
;	Maximum image size is 4096 x 4096
;	Maximun pixel depth is 1000
;	
;	Usage: 				File > Create > New RGB image

(define (script-fu-make-new-RGB-image width height depth fgcolor bgcolor)
 (let* (
		(image (car (gimp-image-new width height RGB)))
        (layer (car (gimp-layer-new image width height
                     RGB-IMAGE "Layer" 100 NORMAL-MODE))))
	    (gimp-context-set-background bgcolor)
        (gimp-drawable-fill layer BACKGROUND-FILL)
		(gimp-context-set-foreground fgcolor)
        (gimp-image-insert-layer image layer 0 0)
	    (gimp-image-set-resolution image depth depth)
	    (gimp-display-new image)
        image)
	 	)

   (script-fu-register
    "script-fu-make-new-RGB-image"                    	
    "Make new RGB image"                                 	
    "Makes an RGB image from user input."					              	
    "hnd"                             				  	
    "2017, hnd"        								
    "May 19th, 2017"                          			
    ""
	SF-ADJUSTMENT	_"Width"		'(100 1 4096 1 5 0 0)
	SF-ADJUSTMENT	_"Height"		'(100 1 4096 1 5 0 0)
	SF-ADJUSTMENT	_"Depth"		'(100 1 1000 1 5 0 0)
	SF-COLOR 		_"Foreground"	'(red green blue)
	SF-COLOR		_"Background"	'(red green blue)
  )
  
  (script-fu-menu-register "script-fu-make-new-RGB-image" 
						"<Image>/File/Create/New RGB image")
;
;
;   This program is free software; you can redistribute it and/or modify
;   it under the terms of the GNU General Public License as published by
;   the Free Software Foundation; either version 2 of the License, or
;   (at your option) any later version.
;
;   This program is distributed in the hope that it will be useful,
;   but WITHOUT ANY WARRANTY; without even the implied warranty of
;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;   GNU General Public License for more details.
;
;   You should have received a copy of the GNU General Public License along
;   with this program; if not, write to the Free Software Foundation, Inc.,
;   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.