If the photos are stored inside an iPhoto / Photos Library that looks like a single file, you can do a right-click > Show Package Contents to see inside of that file,
Very likely, at some level, you will find photos in .JPG or .HEIC or some other usable format.
The organization of the photos inside the package file might not very friendly. I believe that old versions of iPhotos and Photos may have sorted the library by date, but more recent ones sort it by some horrible hash names that only have meaning to the program itself.
Note that I would not suggest changing anything inside the package as you could destroy the ability of iPhoto or or Photos to read this. In fact, if we're only talking about a few photos, you might want to make a working copy of the package file that is separate from your archival and backup copies, so that if you destroy the working copy, you are not destroying the originals (and you can just make another copy of them and try again).