Re: [rfc-i] No, constraining to a custom SVG profile is not trivial

Brian E Carpenter <brian.e.carpenter@gmail.com> Thu, 16 January 2020 18:49 UTC

Return-Path: <rfc-interest-bounces@rfc-editor.org>
X-Original-To: ietfarch-rfc-interest-archive@ietfa.amsl.com
Delivered-To: ietfarch-rfc-interest-archive@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 75F48120B46 for <ietfarch-rfc-interest-archive@ietfa.amsl.com>; Thu, 16 Jan 2020 10:49:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.499
X-Spam-Level:
X-Spam-Status: No, score=-4.499 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=fail (2048-bit key) reason="fail (body has been altered)" header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bxZoMxppj1cU for <ietfarch-rfc-interest-archive@ietfa.amsl.com>; Thu, 16 Jan 2020 10:49:43 -0800 (PST)
Received: from rfc-editor.org (rfc-editor.org [4.31.198.49]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0600C120B3D for <rfc-interest-archive-eekabaiReiB1@ietf.org>; Thu, 16 Jan 2020 10:49:43 -0800 (PST)
Received: from rfcpa.amsl.com (localhost [IPv6:::1]) by rfc-editor.org (Postfix) with ESMTP id C80C9F40717; Thu, 16 Jan 2020 10:49:38 -0800 (PST)
X-Original-To: rfc-interest@rfc-editor.org
Delivered-To: rfc-interest@rfc-editor.org
Received: from localhost (localhost [127.0.0.1]) by rfc-editor.org (Postfix) with ESMTP id 8ADE8F40717 for <rfc-interest@rfc-editor.org>; Thu, 16 Jan 2020 10:49:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at rfc-editor.org
Authentication-Results: rfcpa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from rfc-editor.org ([127.0.0.1]) by localhost (rfcpa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q8vfvOWmPvlS for <rfc-interest@rfc-editor.org>; Thu, 16 Jan 2020 10:49:34 -0800 (PST)
Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by rfc-editor.org (Postfix) with ESMTPS id 6E9BBF4070F for <rfc-interest@rfc-editor.org>; Thu, 16 Jan 2020 10:49:34 -0800 (PST)
Received: by mail-pj1-x1041.google.com with SMTP id r67so1960066pjb.0 for <rfc-interest@rfc-editor.org>; Thu, 16 Jan 2020 10:49:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=fDL7bTBAYE5GWlvQ9g4iP1dvsJocnjRCKQtAIgQ6RdE=; b=XbKxXyX604V/fB0dm6LNO/ydZ5jDl8vyzav4CGXHE1dlKzoxaAGbUi08u2tg7UmQuS 1zoSdUbzjNHj8fCEAN8JroqqjKWbDP+FUvkQW4ZUi0V7mjgNaWwrPOADfMAObUKxNW0f 8dEU0FqwiRgy0z/WKnds/zq85WQ2Mv/pxIF2oL7qWpb7LI9n2xe/mDs+uDXt4qZhbQAS UdIeEz72KP8dFvjPyoynBbz3wMn+xh3J/R+PR3bYhQKk43vpS6LxdH5FZlmOWCis/uo2 ViNfL00KC/FBRz6uhoApnvzirMs7Xh98rVl/K+RWggWkXPNKpwcgqrvFax63aoFf4On9 WJWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fDL7bTBAYE5GWlvQ9g4iP1dvsJocnjRCKQtAIgQ6RdE=; b=taAYtHVZMj70EoIwVLN+gOnPpixXpH1CNeLJMin+JKtdCUkdGVvO6bhSrErhgksv6o HnWyNAHTpAowHuMDlE+hl/Pn5qcZ2URplNVhY2r1LegvWEpMto06g5GREcf/X7oQz7C6 Gp0Co7a58tbMweqCWP3mwpjF3i2V85asy/TD0QTiFrtJXbTGUplv+ABoAFoN29neXVte SSUlQfj46Z/DkhoSdhlespW/FMTpDtf0wjf2YhKAkIUoH2IwJB9i4udRwAeJ+WN5fNiD o3tSxH6/f85PdMKIcKW20/tgMynpYmEHoe2BG2WCpmrW93ft+JKIuG18a5QlVolADOsM h/JQ==
X-Gm-Message-State: APjAAAWZ9T28dl6Ps3j85q/7Lphi2KHVpHcCvppssqmT23Mu1r27Yb0f v87AJ7opIH9wMdId1rBSJxTOw0Se
X-Google-Smtp-Source: APXvYqxZL4NYpuYevW6GuhfACuEBdQVaEheTTgy+ObZLsm3jm0BfH5i7jCZL2TWJR1vh+k3t5HCCVw==
X-Received: by 2002:a17:90a:5215:: with SMTP id v21mr654577pjh.31.1579200577467; Thu, 16 Jan 2020 10:49:37 -0800 (PST)
Received: from [172.17.0.82] ([111.69.8.186]) by smtp.gmail.com with ESMTPSA id k12sm24575238pgm.65.2020.01.16.10.49.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jan 2020 10:49:36 -0800 (PST)
To: Doug Royer <douglasroyer@gmail.com>, RFC Interest <rfc-interest@rfc-editor.org>
References: <CAMm+LwiXhhJO7qYi41+DC4W7uMUVipXqyq75Fq2vagA1ppJNdA@mail.gmail.com> <10cca93f-a8b8-4c42-0653-3b12fa67ad12@gmail.com> <CAMm+LwgA-1UffBfrH-Y3J6pfh7ni9kNrndp=gHNyUyi5j=oLxg@mail.gmail.com> <53607da4-6608-783b-b875-65551e3add19@gmail.com> <c25db7f1-509d-062d-c5bf-ffa48bd892fb@gmail.com>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Message-ID: <c14d5500-cff9-e298-3302-65a43ee4258a@gmail.com>
Date: Fri, 17 Jan 2020 07:49:33 +1300
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1
MIME-Version: 1.0
In-Reply-To: <c25db7f1-509d-062d-c5bf-ffa48bd892fb@gmail.com>
Content-Language: en-US
Subject: Re: [rfc-i] No, constraining to a custom SVG profile is not trivial
X-BeenThere: rfc-interest@rfc-editor.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "A list for discussion of the RFC series and RFC Editor functions." <rfc-interest.rfc-editor.org>
List-Unsubscribe: <https://www.rfc-editor.org/mailman/options/rfc-interest>, <mailto:rfc-interest-request@rfc-editor.org?subject=unsubscribe>
List-Archive: <http://www.rfc-editor.org/pipermail/rfc-interest/>
List-Post: <mailto:rfc-interest@rfc-editor.org>
List-Help: <mailto:rfc-interest-request@rfc-editor.org?subject=help>
List-Subscribe: <https://www.rfc-editor.org/mailman/listinfo/rfc-interest>, <mailto:rfc-interest-request@rfc-editor.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: rfc-interest-bounces@rfc-editor.org
Sender: rfc-interest <rfc-interest-bounces@rfc-editor.org>

That's exactly what my Python patch does. If R+G+B > 381 return white else black.

It works pretty well if the contrast in the original is sufficient for legibility.

Regards
   Brian

On 16-Jan-20 17:33, Doug Royer wrote:
> On 1/15/20 8:21 PM, Brian E Carpenter wrote:
>>> Attached is a simple XSLT script that I created that simply rips out invalid elements.
>>
>> The problem with colour/greyscale is that this isn't enough. If you have very dark blue text on a very pale pink background, what happens? svgcheck makes this black on black; my heuristic makes it black on white. What would your script do?
> 
> I use this tool with SVG files that I planned to use in this way.
> 
> I have not needed to solve contrast problems yet. When I do, my plan is to make anything more than 50% black, else white.  It can not handle complex SVG with shades of darkness or complex attribute values (like style). If I get energetic, I could do some contrast computation. Never tried anything that complex with XSLT, might have to do some scripting for that.
> 
> The next rev, I am going to tackle the style attribute. I do not know if it is solvable with XSLT. More of an intellectual exercise than a needed goal. If it gets complex, scripting will do.
> 
>> But I do agree with Phill, this is a non-trivial issue. Currently I think doing new drawings with a simple tool like DIA is the only practical way.
> 
> Yea, DIA and the DOT tools just make stick drawings. You can make nice flow and protocol state drawings with the dot tools (and with PIC for those of you that are troff experts).
> 
> 
_______________________________________________
rfc-interest mailing list
rfc-interest@rfc-editor.org
https://www.rfc-editor.org/mailman/listinfo/rfc-interest