Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by midora

  1. I know there is more to do than just setting the flag to true. You are right there is no additional support.

    I used a list of extensions (starting with dots) sorted by length (long ones first) and used EndsWith to find the matching extension type.

    But it's more a suggestion for the future and not something we need just now. And maybe having in mind that this maybe helpful.


    I may also add load to ImPdf if I would know that .im.pdf is supported so that the plugin could expect that the pdf contains just images.

    As long as there is no open dialog which could be canceled you always have to throw an error if the file is valid but does not fulfill the requirements.



  2. I'm getting a reproducable crash closing the ImPDF Save filetype plugin (on OK or cancel).


    Exception details:
    System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
     ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at PaintDotNet.Dialogs.SaveConfigDialog.UpdatePreviewAsync(Document document, FileType fileType, SaveConfigToken saveConfigToken, CancellationToken cancelToken) in D:\src\pdn\src\PaintDotNet\Dialogs\SaveConfigDialog.cs:line 676
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
       at PaintDotNet.Dialogs.SaveConfigDialog.WaitForAndDisableUpdatePreview(WaitActionType waitActionType) in D:\src\pdn\src\PaintDotNet\Dialogs\SaveConfigDialog.cs:line 818
       at PaintDotNet.Dialogs.SaveConfigDialog.OnClosing(CancelEventArgs e) in D:\src\pdn\src\PaintDotNet\Dialogs\SaveConfigDialog.cs:line 338
       at System.Windows.Forms.Form.CheckCloseDialog(Boolean closingOnly)


    This is a filetype which has no load option.

    • Like 1
  3. There are .bmp file format variants which support rle4 and rle8 run-length encoding but still the file must start with "BM". The header contains a compression field telling a reader that the file is using rle.

    If you find a specification and a different file extension someone should be able to create a plugin for the format. I'm sure it would be pretty easy.

    But we can not create bmp files which can not be opened by image viewers.

    Maybe the data is rle4 or rle8 endcoded and someone tried to be clever and save some header bytes compared to the bmp specification.


  4. 4 hours ago, Rick Brewster said:

    For now it'll work fine because all plugins are now loaded into separate AssemblyLoadContexts, which means each plugin gets its own "copy" of your library. But, in general, just don't make assumptions like that.


    I'm pretty sure this was not an assumption 😉. But nobody respects all possible context changes during development. If all plugins are getting a copy it may be more difficult to write a configuration plugin for OBL. May be not. I don't know in the moment.

  5. I guess there are some fundamental misunderstandings in this topic.


    You have to distinguish between the pixel size and the so called print size of an image. The print size is the pixel size multiplied with the dpi value (which you can set in the "Resize..." dialog, which also shows the print size).


    The standard print feature of the operating system is quite limited. If you like to get exact positioning or sizing of the image then you may use the PrintIt plugin. There are several options to respect your expectations and a preview (which also shows the not printable area of your paper depending an printer and paper).

  6. 50 minutes ago, Rick Brewster said:

    As of 4.3, IsReflexive is no longer honored for plugins, and is marked [Obsolete].


    What happens if the filletype just supports save but not open?

    A no preview message in the preview area and the file size is still displayed?

  7. I know it's not the best time to suggest something. A stable 4.3 is the most important thing in the moment.

    But if developers could get an additional plugin interface for tools they could really add value.


    I had this in mind when I designed the user interface of the Spirit Level plugin (years ago).



    Maybe we could start a discussion sometime in the future how a plugin interface for tools could look like.

  8. 13 hours ago, AndrewDavid said:

    I hope you don't mind my posting to GitHub for reference purposes. https://github.com/AndrewDavid007/PdnPropertiesAndControlTypes.


    Hi Andrew, This plugin is a source for developers, so it's fine to move it to the next level.


    13 hours ago, AndrewDavid said:

    It's too bad not every plugin is in GitHub.


    You can say this also for every application (like paint.net 😉). There are always pros and cons. At the end it's the decision of the developer.

    Great that you are improving your skills. Go on.




  9. I'm speculating. The main reason to introduce Window 11 as soon as possible is not about new features it is about money.

    New PCs will get Windows 11 and in the future the basic license will only allow you to install sw from the store. You need TPM to force this.

    Maybe I'm wrong 😉

  10. If you do not depend on the original 256 colors then just use the default settings and press ok.


    Just to finish the sentence 😉

    No idea why I have to fight with this forum in the last months. But tries to edit my post always return with


    "This comment can no longer be edited. It may have been moved or deleted, or too much time may have passed since it was posted for it to be edited."




    • Like 1
  11. Hi @bannerman100you have to know that the gif file format is quite old and just allows a maximum of 256 different colors.

    But paint.net allows you to use millions of different colors. Just drawing a line may create hundreds of new colors in your image.

    Now if you like to save the edited image as gif you need a process to reduce the amount of colors back to the maximum of 256.

    This process is called quantization. You need it or you can not save the image as gif.

    If you do not depend on the original 256 colors





    • Upvote 1
  12. I found the following in the wic documents

    Fixed-Point Numerical Encoding

    16-bit fixed-point values are interpreted as s2.13: sign bit, two integer bits, and thirteen fractional bits. Using this interpretation, a numerical range of −4.0 to +3.999... can be represented, with the value of 1.0 represented by the signed integer value 8192 (0x2000).


    and implemented


            int Fixed16To16bits(int fixed16)
                double d = (double)fixed16 / 0x2000; // 2^13 = 8192 = 0x2000; d is now in the range 0..1
                return (int)(d * 0xFFFF); // 2^16-1 = 65535 = 0xFFFF


    to convert the fixed point to a standard channel value.


    This works so far, but the image in the pdf is a little bit dark. Not sure where to look for this issue in the moment.

    I'm getting a better results by using bitmap.GetPixel() and stretching the 8 bit channel values to 16bit.



  13. I was able to create 64bppArgb Bitmaps and to save them as BMPs with a bitcount of 64-bit.

    It looks like there is gdi+ support nowadays.

    paint.net is able to load these BMPs. Colors and alpha looked ok

    I was wondering about the values in these 16-bit channels. The range is from 0 to 0x2000.  

    (BGRA) (0x2000 0x2000 0x2000 0x2000) seems to be white full opaque.

    Does anybody know if these values are a 16-bit floating point variant and which one?





  14. Still on 4.2.16, there are to many open plugins in development on my side to do the switch now. But I will before publishing updates.

    For grayscale I just use Black and White adjustment before save. To test impdf I need grayscale rasters which use colors in the ordered range [(0,0,0) .. (255,255,255)].
    And I'm not able to get them. Typically they do not contain (0,0,0) and (255,255,255) and the order is random. I can patch the bmps but it would be just good to get raster where you could ignore the palette. PDFs can then use /DeviceGray tags.




  15. Regarding OptionBasedLibrary.

    OBL was still under development when I had to interrupt my support. Some people still continued to use it in their plugins. I guess it makes no sense to get all the old variants of OBL to run. IMHO this is a waste of time. I'm concentrating on the work to finalize a single OBL and get my own plugins to run. In a next step other plugins could be updated (or die 😉


    By the way would it be possible to increase the width of the settings panel a bit in the save dialog? It's really ultra small if a vertical slider is needed. Or even better would be a splitter between settings and preview. 🙂


    • Like 1
  16. The octree quantization works quiet well in general but for grayscale images it creates sometimes colors.

    For grayscale images it would be great to get a switch to generate ordered fixed size palettes [(0,0,0), ... (255,255,255)] (i.e for saving to 8bit, 4bit, 1bit .bmp files).

    Doing this allows a consumer to use the color index in the raster directly as the gray color value (without a lookup into the palette).


  17. I downloaded the protect as zip and could build it (after removing three dead references to System.XXX in CustomFrame/Dependencies/Assemblies).


    The icons are located in resources.cs which uses the namespace CustomFrame.Properties. This namespace embeds the class Resources which contains the embedded icons.



  • Create New...