From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dov Grobgeld Newsgroups: gmane.emacs.devel Subject: Re: Image transformation filter for upscaled images Date: Tue, 9 Mar 2021 15:50:08 +0200 Message-ID: References: <871rcpo3nm.fsf@gnus.org> <87v9a1l4d7.fsf@gnus.org> <87zgzclb5w.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bac08d05bd1ad4a8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26421"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Third , Evgeny Zajcev , Stefan Kangas , emacs-devel To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 09 14:52:07 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJcmL-0006g4-5N for ged-emacs-devel@m.gmane-mx.org; Tue, 09 Mar 2021 14:52:05 +0100 Original-Received: from localhost ([::1]:52216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJcmK-0005FO-7O for ged-emacs-devel@m.gmane-mx.org; Tue, 09 Mar 2021 08:52:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJckq-00046u-MX for emacs-devel@gnu.org; Tue, 09 Mar 2021 08:50:34 -0500 Original-Received: from mail-vs1-xe2c.google.com ([2607:f8b0:4864:20::e2c]:43960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJckl-0005ql-78 for emacs-devel@gnu.org; Tue, 09 Mar 2021 08:50:31 -0500 Original-Received: by mail-vs1-xe2c.google.com with SMTP id w76so6791929vsw.10 for ; Tue, 09 Mar 2021 05:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YHYnuJh+N7bCKn///hM5ziYGpm6u0AV0EkD2GQlVUWY=; b=FfFdMiOaJ7rtfyyh88R4oD2W/3L5tHbGLf22HT8UtfYBw6S8lLFLw1mNIp59LYmvzf y0fgpDyGMZ0SWvoJitrGdIk/dB8sLBbwqisIqnrQdzZhU2AQyRts8i4utZsQYSuc9LJQ PWObEaUrYri2qsgaLPXD2952VLYTvMhXngEUB9tpGnSB5usOOvXdtO43Ky/HAEI2kILR xT5tGEXfw7aYcFgjwmrxM2cgpX2YcPOdufUtXXFkszqbmZRXrAh88Qd6fIPFhr/rD0qS fZETWJbevIEHCdlp8w7MqZzrab9/AHF+R+mWR06XyBGwhiMZic2K8DIEXQFeriLzI5UE r6wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YHYnuJh+N7bCKn///hM5ziYGpm6u0AV0EkD2GQlVUWY=; b=T7lsajzXTP80UJBOVEvNsmw7rOI7c331LginQ+ftajOk67/FNH6s3cZVHMcy2K+ViR v5KXoCIEFFNLWKhTcrRpBkJZ69S/gEJdERlTbqXozKO5RgOfqcin7CCA8X9IbtdWWmXV cDDyZPVsKH8XLSFT5FFnrhqAj9G4luThhly1ih+40Cl9OP33a4lnp7U5wprAYB6eaQXc 8irB0lYvw+AZpN7wcepdw9kt5bql2klsAvv5vvzyY+2j+t+DHjQRO2FkB8RnHyqb3wiB QOTPcTImFYWOnNWZaRr2ss5LECuZp3GjrJfvJ2nvCEsGoUWj0yY50yP3095jImLnoCOo ap8w== X-Gm-Message-State: AOAM530z/aKQtj6ERetREiPDcgAFZlD3DqascQ/hFwLeDnszqflfJF8B /JtbqTQaVWqgv5HiiigJV5Op9JqbNKS98LEp/jQ= X-Google-Smtp-Source: ABdhPJxEVZms2a4gcQDJVa/hEGr/TzAU/2GgoBapSN62frY0ZQVJCokmFzNhPuktMghSgSxiAL56+17UgtKVOHSA7qQ= X-Received: by 2002:a05:6102:37c:: with SMTP id f28mr1011123vsa.34.1615297819360; Tue, 09 Mar 2021 05:50:19 -0800 (PST) In-Reply-To: <87zgzclb5w.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::e2c; envelope-from=dov.grobgeld@gmail.com; helo=mail-vs1-xe2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266242 Archived-At: --000000000000bac08d05bd1ad4a8 Content-Type: text/plain; charset="UTF-8" Note that there are various smart algorithms for bitmap to contour (svg) tracing. E.g. http://potrace.sourceforge.net/ But there are others. One idea would be to use potrace for "small" images and pixel interpolation (or nearest neighbor) for large images. The specification for small and large should be settable by the user. On Tue, Mar 9, 2021 at 3:30 PM Lars Ingebrigtsen wrote: > Evgeny Zajcev writes: > > > I vote for "best" everywhere by default, making doc-view shine out-of-box > > doc-view can call create-image with :filter 'best, so what's best for > doc-view is pretty much irrelevant as to what the default should be. > > The current default works pretty well for most images (just not on > text), so I think it makes sense to not change the default. > > (And, as Alan pointed out, doc-view really should be smarter about this > stuff, and render the PDF in the size it's going to be displayed at.) > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > > --000000000000bac08d05bd1ad4a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Note that there are various smart algorithms for bitmap= to contour (svg) tracing. E.g.


But there are others. One idea would be to use potrace for "smal= l" images and pixel interpolation (or nearest neighbor) for large imag= es. The specification for small and large should be settable by the user.


On Tue, Mar 9, 2021 at 3:30 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:
Evgeny Zajcev <lg.zevlg@gmail.com> writes= :

> I vote for "best" everywhere by default, making doc-view shi= ne out-of-box

doc-view can call create-image with :filter 'best, so what's best f= or
doc-view is pretty much irrelevant as to what the default should be.

The current default works pretty well for most images (just not on
text), so I think it makes sense to not change the default.

(And, as Alan pointed out, doc-view really should be smarter about this
stuff, and render the PDF in the size it's going to be displayed at.)
--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no

--000000000000bac08d05bd1ad4a8--