Sun Apr 26, 2020 1:36 am
Sun Apr 26, 2020 2:45 am
Sun Apr 26, 2020 2:48 am
(script-fu-menu-register "script-fu-create-heart" "<Image>/File/Create")
(script-fu-register
"script-fu-create-heart"
"Create heart..."
"Creates a heart shape image"
"Pocholo"
"Pocholo"
"April 2020"
""
)
(script-fu-menu-register "script-fu-create-heart" "<Image>/File/Create")
Sun Apr 26, 2020 7:34 am
Tue Apr 28, 2020 11:55 pm
Wed Apr 29, 2020 2:13 am
Wed Apr 29, 2020 2:33 am
Wed Apr 29, 2020 11:14 am
; following steps in Create an easy heart with GIMP 2.10 by conbagui found at link:http://fav.me/ddvrolq
; author: Pocholo
; date: 4/25/20
; Comments directed to http://gimpchat.com
; Installation:
; This script should be placed in the user script folder
; Copyright (C)
; 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 3 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, see <https://www.gnu.org/licenses/>.
(define (script-fu-create-heart imgWidth imgHeight foreground-color heart-color)
(let* (
(img (car (gimp-image-new imgWidth imgHeight RGB)))
(layer (car (gimp-layer-new img imgWidth imgHeight RGB-IMAGE "Background" 100 LAYER-MODE-NORMAL)))
(theheart (car (gimp-layer-new img imgWidth imgHeight RGB "Heart" 100 LAYER-MODE-NORMAL)))
(heartcopy 0)
(heart 0)
(theshadow (car (gimp-layer-new img imgWidth imgHeight RGB "Inner shadow" 100 LAYER-MODE-NORMAL)))
(thereflection (car (gimp-layer-new img imgWidth imgHeight RGB "Reflection" 100 LAYER-MODE-NORMAL)))
)
;Create the Background
(gimp-image-undo-disable img) ; Disable undo during the image creation
(gimp-image-insert-layer img layer 0 0)
(gimp-context-set-foreground foreground-color)
(gimp-drawable-fill layer FILL-FOREGROUND)
;Create the heart layer
(gimp-image-add-layer img theheart -1)
(gimp-layer-add-alpha theheart)
(gimp-drawable-fill theheart FILL-TRANSPARENT)
;Create the the first half of the heart
(gimp-image-select-ellipse img 2 60 105 385 285)
(gimp-image-select-rectangle img 1 0 0 500 250)
(gimp-image-select-ellipse img 0 60 125 385 250)
(gimp-context-set-foreground heart-color)
(gimp-drawable-edit-fill theheart FILL-FOREGROUND)
(gimp-selection-none img)
(gimp-drawable-transform-rotate theheart 44.75 TRUE 250 250 0 2 TRUE 1 0)
(gimp-layer-resize-to-image-size theheart)
(gimp-image-select-rectangle img 2 250 0 250 500)
(gimp-edit-cut theheart)
(gimp-selection-none img)
;Create the second half of the heart
(set! heartcopy (car (gimp-layer-copy theheart TRUE)))
(gimp-image-add-layer img heartcopy -1)
(gimp-item-transform-flip-simple heartcopy 0 1 0)
(gimp-image-merge-down img heartcopy 1)
;Create a selection
(set! heartcopy (car (gimp-image-get-active-drawable img)))
(gimp-image-select-color img CHANNEL-OP-REPLACE heartcopy heart-color)
;Create inner shadow layer
(gimp-image-add-layer img theshadow -1)
(gimp-layer-add-alpha theshadow)
(gimp-drawable-fill theshadow FILL-TRANSPARENT)
;Shrink the selection and set the foreground color
(gimp-selection-shrink img 8)
(gimp-context-set-foreground '(0 0 0))
;Set the brush and the size apply
(gimp-context-set-brush "2. Hardness 100")
(gimp-context-get-brush)
(gimp-context-set-brush-size 8)
;Stroke selection and apply gaussian blur
(gimp-edit-stroke theshadow)
(gimp-selection-none img)
(plug-in-gauss RUN-NONINTERACTIVE img theshadow 48 48 1)
;Create the light reflection on the heart
;Create light reflection layer
(gimp-image-add-layer img thereflection 0)
(gimp-layer-add-alpha thereflection)
(gimp-drawable-fill thereflection FILL-TRANSPARENT)
;Draw the dot on the left side and apply gaussian blur
(gimp-image-select-ellipse img 2 150 150 25 25)
(gimp-edit-fill thereflection 2)
(gimp-selection-none img)
;Merge the top two layer
(plug-in-gauss RUN-NONINTERACTIVE img thereflection 18 18 1)
(gimp-image-merge-down img thereflection 1)
(set! theshadow (car (gimp-image-get-active-drawable img)))
(gimp-image-merge-down img theshadow 1)
(gimp-display-new img)
)
)
(script-fu-register
"script-fu-create-heart"
"Create a heart"
"Creates a heart shape image"
"Pocholo"
"Pocholo"
"April 2020"
""
SF-ADJUSTMENT "Image Height" '(500 50 1000 1 10 0 1)
SF-ADJUSTMENT "Image Width" '(500 50 1000 1 10 0 1)
SF-COLOR "Foreground color" "Black"
SF-COLOR "Heart color" "Red"
)
(script-fu-menu-register "script-fu-create-heart" "<Image>/File/Create")
Thu Apr 30, 2020 2:48 am
Thu Apr 30, 2020 12:45 pm
(gimp-image-undo-disable img)
Sun May 03, 2020 2:09 pm
; scale image
(gimp-context-set-interpolation INTERPOLATION-NOHALO) ;The interpolation type { INTERPOLATION-NONE (0), INTERPOLATION-LINEAR (1), INTERPOLATION-CUBIC (2), INTERPOLATION-NOHALO (3), INTERPOLATION-LOHALO (4) }
(gimp-image-scale img imgWidth imgHeight)
Sun May 03, 2020 3:47 pm
Mon May 04, 2020 2:05 am
(scaled (/ imgSize 500))
(* scaled 500)
Mon May 04, 2020 2:08 am
nelo wrote:Still thinkin about this ... how it could be done fairly quick:
What if you just keep your 500px settings to work with and at the end scale the image like so:
- Code:
; scale image
(gimp-context-set-interpolation INTERPOLATION-NOHALO) ;The interpolation type { INTERPOLATION-NONE (0), INTERPOLATION-LINEAR (1), INTERPOLATION-CUBIC (2), INTERPOLATION-NOHALO (3), INTERPOLATION-LOHALO (4) }
(gimp-image-scale img imgWidth imgHeight)
Next thought with this would be to just set only one value for width and height so you'll always have something square.
Edit:
better way: using a scaling factor as attached. Hopefully I didn't oversee stuff, but you'll get the idea.
Mon May 04, 2020 12:32 pm
(define (orange-peel-pattern)
(let* (
(imgWidth 500)
(imgHeight 500)
(img (car (gimp-image-new imgWidth imgHeight RGB)))
(layer (car (gimp-layer-new img imgWidth imgHeight RGB-IMAGE "Background" 100 LAYER-MODE-NORMAL)))
)
(gimp-context-push)
; Begin Undo Group
(gimp-image-undo-group-start img)
;Create the Background
(gimp-image-insert-layer img layer 0 0)
(gimp-context-set-foreground '(241 152 56))
(gimp-drawable-fill layer FILL-FOREGROUND)
;Create the orange peel
(plug-in-hsv-noise RUN-NONINTERACTIVE img layer 8 3 4 150)
(plug-in-gmic-qt 1 img layer 0 0 "fx_relief_light 0.1 0, 0, 0, 0.3, 0, 0, 0, 0.03, 0, 0.3")
(gimp-display-new img)
;End Undo Group
(gimp-image-undo-group-end img)
(gimp-displays-flush)
;Resets previous user settings
(gimp-context-pop)
Mon May 04, 2020 2:12 pm
Mon May 04, 2020 2:43 pm