Re: [Gimp-user] reading from txt file

2019-07-08 Thread Simon Budig
Hi.

charlysangel (for...@gimpusers.com) wrote:
> I've tried to read from file with code below
> 
> (let* ((fd (fopen filename)))
>(let*(
>   (c (fread 1 fd))
>   (res "")
>   )
>(while (and c (not (equal? c " ")))
>   (set! res (string-append res c))
>   (set! c (fread 1 fd)))
>   (if (equal? res "")
>  ()
>  (cons (string->number res) ())
>   )
>)
>(gimp-message (string-append "PosX: " (number->string res)))
> )
> 
> I do not understand why it returns :"Error: eval: unbound variable: res "

The inner let*-Block declaring the "res" variable is closed in the line
immediately before the gimp-message call.

Hence "res" is no longer available when evaluating the line with
gimp-message, resulting in the error message you see.

Bye,
 Simon
-- 
  si...@budig.de  http://simon.budig.de/
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] reading from txt file

2019-07-08 Thread Shlomi Fish
On Mon, 08 Jul 2019 10:32:54 +0200
charlysangel  wrote:

> Hi !
> 
> I want to create a multi-layer file by reading from a txt file x/y position
> and image name.
> 
> I've tried to read from file with code below
> 
>   (let* ((fd (fopen filename)))
>   (let*   (
>   (c (fread 1 fd))
>   (res "")
>   )
>   (while (and c (not (equal? c " ")))
>   (set! res (string-append res c))
>   (set! c (fread 1 fd)))
>   (if (equal? res "")
>   ()
>   (cons (string->number res) ())
>   )
>   )
>   (gimp-message (string-append "PosX: " (number->string
> res))) )
> 
> I do not understand why it returns :"Error: eval: unbound variable: res "
> 
> Could you help, please ?
> 
> 

Hi!

Perhaps use python instead of scheme and use line-based i/o and
https://github.com/shlomif/Freenode-programming-channel-FAQ/blob/master/FAQ_with_ToC__generated.md#where-can-i-learn-to-write-andor-read-regular-expressions
instead of byte by byte read.

-- 
-
Shlomi Fish   http://www.shlomifish.org/
UNIX Fortune Cookies - http://www.shlomifish.org/humour/fortunes/

In the beginning the Universe was created. This has made a lot of people very
angry and been widely regarded as a bad move.
— https://en.wikiquote.org/wiki/The_Hitchhiker's_Guide_to_the_Galaxy

Please reply to list if it's a mailing list post - http://shlom.in/reply .
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


[Gimp-user] ghost outline

2019-07-08 Thread rich404
>Newbie here. When removing background from black and white line art,
>there remains a thin white ghost outline around the black object.
>Really shows up when a color background layer is below. Especially a
>problem as I want to use as a logo. Cannot find any tutorials on this
>except as removing foreground image in photo.

All to do with anti-aliasing. Assuming you are using Windows and Gimp 2.10

You have an alpha channel on your xcf but only one layer. Since B & W line art
assuming a colour select on the white and a delete might give something like
screenshot 1

You can mess around with the threshold value but the usual way is grow the
selection by 1 (or 2) pixel(s) to include the semi-transparent pixels before
deleting. Select menu -> Grow.  screenshot 2

With Gimp 2.10 the color 2 alpha tool Color menu -> Color to Alpha is adjustable
and should give a good result. screenshot 3

A more comprehensive description here:

https://www.gimp-forum.net/Thread-Background-removal-or-replacement-on-text-logos-and-other-computer-graphics

Attachments:
* https://www.gimpusers.com/system/attachments/1210/original/01-remove.jpg
* https://www.gimpusers.com/system/attachments/1211/original/02-remove.jpg
* https://www.gimpusers.com/system/attachments/1212/original/03-remove.jpg

-- 
rich404 (via www.gimpusers.com/forums)
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


[Gimp-user] reading from txt file

2019-07-08 Thread charlysangel
Hi !

I want to create a multi-layer file by reading from a txt file x/y position and
image name.

I've tried to read from file with code below

(let* ((fd (fopen filename)))
(let*   (
(c (fread 1 fd))
(res "")
)
(while (and c (not (equal? c " ")))
(set! res (string-append res c))
(set! c (fread 1 fd)))
(if (equal? res "")
()
(cons (string->number res) ())
)
)
(gimp-message (string-append "PosX: " (number->string 
res)))
)

I do not understand why it returns :"Error: eval: unbound variable: res "

Could you help, please ?


-- 
charlysangel (via www.gimpusers.com/forums)
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list