Fri Dec 14, 2012 2:16 pm
Fri Dec 14, 2012 3:36 pm
Sat Dec 15, 2012 8:01 am
Mon Dec 17, 2012 4:06 pm
Gino D wrote:... choose the interpolation method among the usual ones provided by GIMP, ...[and]... to be available through the "Repeat Last" and "Re-show Last"
Mon Dec 17, 2012 5:54 pm
Mon Dec 17, 2012 6:07 pm
RobA wrote:Thanks for the feedback - the image mode as "" was just an oversight, and should have been there.
Good call on the use of SF-ENUM. Added..
Mon Dec 17, 2012 8:35 pm
(define (script-fu-resizebyarea img inLayer interpolation inWidth inHeight)
(let*
((w (car (gimp-image-width img)))
(h (car (gimp-image-height img)))
(a (* inWidth inHeight))
)
; it begins here
(gimp-context-push)
(gimp-image-undo-group-start img)
(gimp-image-scale-full img
(max 1 (min 262144 (round (* w (sqrt (/ a (* w h)))))))
(max 1 (min 262144 (round (* h (sqrt (/ a (* w h)))))))
interpolation)
(gimp-image-undo-group-end img)
(gimp-displays-flush)
(gimp-context-pop)
)
)
(script-fu-register "script-fu-resizebyarea"
"<Image>/Image/Resize by Area..."
"Resize by Area"
"Rob Antonishen"
"Rob Antonishen"
"Dec 2012"
""
SF-IMAGE "image" 0
SF-DRAWABLE "drawable" 0
SF-ENUM "Interpolation" '("InterpolationType" "cubic")
SF-ADJUSTMENT "Equivalent Width" '(1000 1 10000 10 1000 0 1)
SF-ADJUSTMENT "Equivalent Height" '(1000 1 10000 10 10000 0 1)
)
Tue Dec 18, 2012 6:27 am
Graechan wrote:Gino D to add a choice for interpolation just modify your script to this ↓
- Code:
(gimp-image-scale-full img
(max 1 (min 262144 (round (* w (sqrt (/ a (* w h)))))))
(max 1 (min 262144 (round (* h (sqrt (/ a (* w h)))))))
interpolation)
Tue Dec 18, 2012 8:43 am
Tue Dec 18, 2012 2:36 pm
RobA wrote:Attached is the updated script that works in 2.6.x (calling interpolate-full) and later versions (setting the context and then calling the default interpolate).
Wed Dec 19, 2012 3:30 pm
Thu Dec 20, 2012 4:10 am
Graechan wrote:Gino D this is the list I use Gimp-enums
Thu Dec 20, 2012 7:51 am
AddMaskType BlendMode BrushApplicationMode BrushGeneratedShape BucketFillMode ChannelOps ChannelType CloneType ConvertDitherType ConvertPaletteType ConvolutionType ConvolveType DesaturateMode DodgeBurnType FillType ForegroundExtractMode GradientSegmentColor GradientSegmentType GradientType GridStyle HistogramChannel HueRange IconType ImageBaseType ImageType InkBlobType InterpolationType LayerModeEffects MaskApplyMode MergeType MessageHandlerType OffsetType OrientationType PDBArgType PDBErrorHandler PDBProcType PDBStatusType PaintApplicationMode ProgressCommand RepeatMode RotationType RunMode SelectCriterion SizeType StackTraceMode TextDirection TextHintStyle TextJustification TransferMode TransformDirection TransformResize UserDirectory VectorsStrokeType
Thu Dec 20, 2012 12:24 pm
saulgoode wrote:Gino D, you should be able to find all of the GIMP enumerated types within http://git.gnome.org/browse/gimp/tree/l ... h=gimp-2-8
Thu Dec 20, 2012 6:03 pm