Image resizing quality vs basic photoshop resize

  1. 2 weeks ago

    Tom I

    Feb 14 Pre-Release Testers, Xojo Pro Chicago, IL

    I'm attempting to scale down photos to smaller previews, and pretty much every technique I've used results in jagged edges that look horrible. I've tried:

    • Simply drawing the new picture using the ppx.Graphics.DrawPicture(p,0,0,newW,newH,0,0,p.Width,p.Height) method
    • MBS plugin ScalingMBS (using all of the different options)

    Photoshop uses bicubic resampling apparently and this must make a huge difference. Notice the difference between the two images below:

    -image-
    -image-

    Any way to get a better image when reducing size?

  2. Michel B

    Feb 14 Pre-Release Testers, Xojo Pro

    There was a long thread about precisely that a while ago. Unfortunately, I was not able to locate it back.

    I remember Ulrich Bogun shared his insight in there.

  3. Tom I

    Feb 14 Pre-Release Testers, Xojo Pro Chicago, IL

    https://forum.xojo.com/9403-scale-quality-of-canvas-control

    Couldn't find an actual usable answer from there though.

  4. Markus R

    Feb 14 Pre-Release Testers, Xojo Pro Europe / Germany / Lower Saxon...
    Edited 2 weeks ago

    does this something different?

     ppx.Graphics.AntiAliasMode = Global.Graphics.AntiAliasModes.HighQuality

    u can set this also in the paint event g.AntiAliasMode =

  5. Julian S

    Feb 14 Pre-Release Testers, Xojo Pro UK
    Edited 2 weeks ago

    Can you link the original image so we can have a play?

  6. Jeff T

    Feb 14 Pre-Release Testers Midlands of England, Europe

    Honestly struggling to tell which one you think is better and which was produced by each of the two methods.
    maybe its the size, maybe its my eyes...
    Does anyone expect a preview to be photo-glorious?

  7. Christian S

    Feb 14 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany
    Edited 2 weeks ago

    You could use GMImageMBS class which has many more modes.

  8. Alberto D

    Feb 14 Pre-Release Testers, Xojo Pro

    @Julian S Can you link the original image so we can have a play?

    Not the same but close enough:
    https://scene7.zumiez.com/is/image/zumiez/Zoom_PDP/Champion-Reverse-Weave-Blue-Crop-Hoodie-_327999-alt1-US.jpg

  9. Julian S

    Feb 14 Pre-Release Testers, Xojo Pro UK
    Edited 2 weeks ago

    Try this before your g.DrawPicture

    g.AntiAliasMode = Graphics.AntiAliasModes.HighQuality

    Edit: Oh Markus already mentioned this #include "glasses.h"

  10. Emile S

    Feb 14 Europe (France, Strasbourg)

    A two steps resize leads to a better result, but will it meets your needs ?

    Resize a larger image once to an intermediate size, then resize that into the real target (needed) size. (simple DrawPictures)

  11. Tom I

    Feb 14 Pre-Release Testers, Xojo Pro Chicago, IL

    @Julian S Can you link the original image so we can have a play?

    Sorry for the delay, here's the original:
    -image-

  12. Tom I

    Feb 14 Pre-Release Testers, Xojo Pro Chicago, IL

    @Jeff T Honestly struggling to tell which one you think is better and which was produced by each of the two methods.
    maybe its the size, maybe its my eyes...
    Does anyone expect a preview to be photo-glorious?

    Look at the hair, as well as the outline of the blue hoodie, it's much more pixellated and jagged in the top image (created using the app) vs the bottom image (created using Photoshop).

  13. Anthony C

    Feb 14 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store, Forum Moderators, MVP GraffitiSuite Developer

    I use the ImagePlay Effects Library quite a bit. It's got some nice functionality.

  14. Tom I

    Feb 14 Pre-Release Testers, Xojo Pro Chicago, IL

    @Markus R does this something different?

     ppx.Graphics.AntiAliasMode = Global.Graphics.AntiAliasModes.HighQuality

    u can set this also in the paint event g.AntiAliasMode =

    This is about the same, it's the bottom right in the screenshot below, top right is app without anti-alias setting, bottom left is photoshop.
    -image-

  15. Julian S

    Feb 14 Pre-Release Testers, Xojo Pro UK

    Are you resizing it into a picture then resizing the picture again because it looks fine here on windows. It might be a mac thing, what version of macos and xojo are you using?

  16. Julian S

    Feb 14 Pre-Release Testers, Xojo Pro UK

    Break after ppx.Graphics.DrawPicture(p,0,0,newW,newH,0,0,p.Width,p.Height) and check that ppx.Graphics.AntiAliasMode was set to HighQuality

    Try the following, replace pic with your image, it works fine here on 2019r3.1 on W10 and Mojave, no jaggies

    https://www.dropbox.com/s/px2le8bw0203t79/TestImageResizeJagged.xojo_binary_project?dl=0

  17. Markus R

    Feb 14 Pre-Release Testers, Xojo Pro Europe / Germany / Lower Saxon...
    Edited 2 weeks ago

    no problem at xojo2019r31, there are no ugly hard edges.
    did you overwrite AntiAlias in graphics card driver?
    as i understood there is direct draw between at windows.

    i dropped your example picture into a project and then use a canvas to paint, direct and indirect
    in canvas i set all 4 anchor for testing it with window resize.

    Sub Paint(g As Graphics, areas() As REALbasic.Rect) Handles Paint
      Var pic As New Picture(256,512) 'just for test should have minimum the size of canvas or it get blurry
      pic.Graphics.AntiAliasMode = Global.Graphics.AntiAliasModes.HighQuality
      pic.Graphics.DrawPicture(TestAntiAliasMode,0,0,pic.Graphics.Width,pic.Graphics.Height,0,0,TestAntiAliasMode.Width,TestAntiAliasMode.Height)
      
      g.AntiAliasMode = Global.Graphics.AntiAliasModes.HighQuality
    'direct
      'g.DrawPicture(TestAntiAliasMode,0,0,g.Width,g.Height,0,0,TestAntiAliasMode.Width,TestAntiAliasMode.Height)
      
      g.DrawPicture(pic,0,0,g.Width,g.Height,0,0,pic.Width,pic.Height)
      
    End Sub
  18. last week

    Hello,
    in canvas, pictures can be drawn well if they were previously
    converted into a pixmap shape

    Var px As pixmapshape
    px = New pixmapshape(pix2)
    rem Draw smaller or larger in canvas with a mousewheel
    big As Double
    big= px.scale + deltay/30
    px.scale = big
    // mousedown:
    Picture.Graphics.DrawObject px,x,y
    //Paint:
    g.drawobject px,posx,posy

    rem or rotate
    rem With a timer you can also let the Pic2 turn automatically

    Var rotatingwheel As Double
    rotatingwheel = CDbl(angulardegrees.Text)+deltay
    If Abs(rotatingwheel) > 360 Then rotatingwheel=0
    angulardegrees.value = rotatingwheel.ToString
    If px <> Nil Then
    px.rotation=rotatingwheel / 57.29577951311
    Canvas1.Invalidate(False)// Paint:
    End If

  19. https://www.dropbox.com/s/0bzv7iz5xrjab74/test-angleandsize.xojo_binary_project?dl=1

  20. Newer ›

or Sign Up to reply!